You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
ffae48d750
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.
12 lines
116 B
Python
12 lines
116 B
Python
# test constant optimisation
|
|
|
|
X = const(123)
|
|
Y = const(X + 456)
|
|
|
|
print(X, Y + 1)
|
|
|
|
def f():
|
|
print(X, Y + 1)
|
|
|
|
f()
|