Search found 168 matches

by v923z
Sat Feb 15, 2020 6:55 pm
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

Re: implementing properties in user modules

OK, so you are, in principle, willing to accept changes to the micropython core. Just to be clear -- this is just my suggestion as someone who spends a moderate amount of time spelunking in the core (but without any actual authority or ability to accept changes). For future reference: without losin...
by v923z
Sat Feb 15, 2020 4:08 pm
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

Re: implementing properties in user modules

OK, so you are, in principle, willing to accept changes to the micropython core. Just to be clear -- this is just my suggestion as someone who spends a moderate amount of time spelunking in the core (but without any actual authority or ability to accept changes). Don't worry, I didn't take your ear...
by v923z
Sat Feb 15, 2020 12:15 pm
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

Re: implementing properties in user modules

My recommendation would be that if you need ulab to support an API based on properties, then write a facade in Python that implements it, and only provide the very core low-level perf-critical stuff in a simple low-level API in C. This is definitely a possible workaround, though, that would mean th...
by v923z
Sat Feb 15, 2020 11:25 am
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

Re: implementing properties in user modules

Thanks for the prompt reply! Unfortunately, that doesn't cut it. I should have posted my code at the very beginning, so we could've saved an extra round. Sorry for that. FWIW, CircuitPython is a very heavy user of properties (including for builtin types) so it's worth looking at how they do it. Wel...
by v923z
Sat Feb 15, 2020 9:10 am
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

Re: implementing properties in user modules

You do not need anything at all from objproperty.c, if you want a.x to get a value you can implement that in attr for instance (there might be more suitable ways, depends on specific use case). Pseudcode: static void attr(mp_obj_t self_in, qstr attr, mp_obj_t* dest) { if(dest[ 0 ] == MP_OBJ_NULL) {...
by v923z
Sat Feb 15, 2020 8:57 am
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

Re: implementing properties in user modules

You do not need anything at all from objproperty.c, if you want a.x to get a value you can implement that in attr for instance (there might be more suitable ways, depends on specific use case). Pseudcode: static void attr(mp_obj_t self_in, qstr attr, mp_obj_t* dest) { if(dest[ 0 ] == MP_OBJ_NULL) {...
by v923z
Sat Feb 15, 2020 7:47 am
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

Re: implementing properties in user modules

Hi Jim, Thanks for the prompt reply! Unfortunately, that doesn't cut it. I should have posted my code at the very beginning, so we could've saved an extra round. Sorry for that. In any case, here is my complete code #include <stdio.h> #include "py/runtime.h" #include "py/obj.h" typedef struct _prope...
by v923z
Fri Feb 14, 2020 11:39 pm
Forum: Development of MicroPython
Topic: implementing properties in user modules
Replies: 17
Views: 8841

implementing properties in user modules

Hi all,

What is the proper way of implementing properties in user modules? objproperty.c doesn't have a matching header file, so it is not clear, how I am supposed to user properties. Attributes won't do, because they override the locals dictionary.

I would appreciate any hints.

Cheers,

Zoltán
by v923z
Tue Nov 05, 2019 7:14 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 108
Views: 91966

Re: ulab, or what you will - numpy on bare metal

Hi all, I am a bit confused by the specified flash size of the D series. According to the store's web site, https://store.micropython.org/product/PYBD-SF3-W4F2, they all should have at least 2 MB flash (external, with execute capability), yet, I can't compile the firmware with ulab enabled for the S...
by v923z
Mon Nov 04, 2019 9:23 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 108
Views: 91966

Re: ulab, or what you will - numpy on bare metal

In any case, if you can compile a working piece of firmware with the latest source as @jimmo suggested, would you mind reporting back here? If it is still not working, then I would be interested in finding out where the problem lies. I did compile a working version based on micropython 1.11 (6f75c4...