Page 2 of 2

Re: Module for TMP102 temperature sensor

Posted: Thu Jun 19, 2014 1:53 pm
by randomhuman
fma wrote:I like your approach!
Thanks!

Re: Module for TMP102 temperature sensor

Posted: Thu Jun 19, 2014 2:26 pm
by randomhuman
pfalcon wrote:
I guess string constants are retained even if they are not being referenced by anything?
Yes, all constant strings which appear in script are interned. But again, we made change that expressions consisting of just strings (which covers docstrings) are discarded. Submitting a bug for this issue will make sure it's revisited and not forgotten.
Before I submit any more bugs I should probably learn to build the project and flash the board and all that good stuff - it probably is fixed as you say, but I'm still running the version of micropython that came on my board and I haven't tried the unix version or anything.

Re: Module for TMP102 temperature sensor

Posted: Thu Jun 19, 2014 3:41 pm
by randomhuman
I flashed my board and it looks like that issue with the docstrings is at least partially resolved - space is allocated for them on import, but the garbage collector removes them when it runs. Seems adequate to me? I will log a bug if you disagree.

Re: Module for TMP102 temperature sensor

Posted: Thu Jun 19, 2014 7:26 pm
by pfalcon
Hmm, I'd guess parser could free such strings explicitly, saving gc from extra work, so I'd suggest filing a bug.

Re: Module for TMP102 temperature sensor

Posted: Thu Jun 19, 2014 10:50 pm
by randomhuman

Re: Module for TMP102 temperature sensor

Posted: Sat Jul 12, 2014 2:43 pm
by Turbinenreiter
This means that we should include docstrings in micropython modules, right?

Re: Module for TMP102 temperature sensor

Posted: Sat Jul 12, 2014 4:43 pm
by pfalcon
You can, and you should not be concerned that they may waste memory when run on MicroPython (they won't).