Page 2 of 2

Re: implementing properties in user modules

Posted: Sat Feb 15, 2020 12:54 pm
by jimmo
v923z wrote:
Sat Feb 15, 2020 12:15 pm
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).

Re: implementing properties in user modules

Posted: Sat Feb 15, 2020 4:08 pm
by v923z
jimmo wrote:
Sat Feb 15, 2020 12:54 pm
v923z wrote:
Sat Feb 15, 2020 12:15 pm
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 earlier comment as an outright promise.

Re: implementing properties in user modules

Posted: Sat Feb 15, 2020 6:55 pm
by v923z
jimmo wrote:
Sat Feb 15, 2020 12:54 pm
v923z wrote:
Sat Feb 15, 2020 12:15 pm
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 losing sight of your comment, I have created a pull request with the necessary changes: https://github.com/micropython/micropython/pull/5648

And you were right, lifting code verbatim from circuitpython's runtime.c fixes the issue.

Re: implementing properties in user modules

Posted: Sat Feb 15, 2020 7:18 pm
by stijn
v923z wrote:
Sat Feb 15, 2020 9:10 am
That overrides the locals dictionary, so nothing defined in the locals will be available as a class method.
Yup, forgot we use a custom attr function which does all of that, i.e. first lookup locals dict then property getters etc

Re: implementing properties in user modules

Posted: Sat Feb 15, 2020 7:24 pm
by v923z
stijn wrote:
Sat Feb 15, 2020 7:18 pm
v923z wrote:
Sat Feb 15, 2020 9:10 am
That overrides the locals dictionary, so nothing defined in the locals will be available as a class method.
Yup, forgot we use a custom attr function which does all of that, i.e. first lookup locals dict then property getters etc
Just curious: who is "we"? You did exactly what Jim's suggested earlier, right?

Re: implementing properties in user modules

Posted: Sat Feb 15, 2020 8:08 pm
by stijn
Talking about https://github.com/stinos/micropython-w ... per.h#L372 bascially. With 'we' I meant 'me and colleagues' but actually I wrote all of it so on second thought: yes would be less confusing to just say 'I' :D

Re: implementing properties in user modules

Posted: Sun Feb 16, 2020 3:11 pm
by v923z
stijn wrote:
Sat Feb 15, 2020 8:08 pm
Talking about https://github.com/stinos/micropython-w ... per.h#L372 bascially. With 'we' I meant 'me and colleagues' but actually I wrote all of it so on second thought: yes would be less confusing to just say 'I' :D
Sorry, I wasn't nit-picking, I was simply curious. This wrapper project of yours is really interesting.

Re: implementing properties in user modules

Posted: Mon Feb 17, 2020 9:03 am
by stijn
Oh no problem I didn't treat it as nit-picking, I genuinely think saying 'we' is confusing because it doesn't convey any meaning to others.
This wrapper project of yours is really interesting.
Thanks! It didn't completely turn out the way I wanted but if you have to wrap hundreds of functions/classes it's quite the timesaver