<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/tests/micropython/const.py, branch 6.0.0</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=6.0.0'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-09-27T03:34:21+00:00</updated>
<entry>
<title>py/modmicropython: Add micropython.const, alias for identity function.</title>
<updated>2016-09-27T03:34:21+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-09-27T03:34:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=791b65f4b261a23e427664f0b86ce32b60e33cb5'/>
<id>urn:sha1:791b65f4b261a23e427664f0b86ce32b60e33cb5</id>
<content type='text'>
Having a micropython.const identity function, and writing "from micropython
import const" at the start of scripts that use the const feature, allows to
write scripts which are compatible with CPython, and with uPy builds that
don't include const optimisation.

This patch adds such a function and updates the tests to do the import.
</content>
</entry>
<entry>
<title>py/parse: Treat constants that start with underscore as private.</title>
<updated>2016-06-06T16:28:32+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-06-06T16:28:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=b1533c43669c037d04c87d1756355cdc8edd5e0a'/>
<id>urn:sha1:b1533c43669c037d04c87d1756355cdc8edd5e0a</id>
<content type='text'>
Assignments of the form "_id = const(value)" are treated as private
(following a similar CPython convention) and code is no longer emitted
for the assignment to a global variable.

See issue #2111.
</content>
</entry>
<entry>
<title>py, compiler: Add basic support for A=const(123).</title>
<updated>2014-05-08T15:58:39+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2014-05-08T15:58:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ffae48d7507d398806bd935b054b7ca19bc01161'/>
<id>urn:sha1:ffae48d7507d398806bd935b054b7ca19bc01161</id>
<content type='text'>
You can now do:

    X = const(123)
    Y = const(456 + X)

and the compiler will replace X and Y with their values.

See discussion in issue #266 and issue #573.
</content>
</entry>
</feed>
