1 Star 0 Fork 0

sam/circuitpython

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
const.py 302 Bytes
Copy Edit Raw Blame History
# test constant optimisation
from micropython import const
X = const(123)
Y = const(X + 456)
print(X, Y + 1)
def f():
print(X, Y + 1)
f()
_X = const(12)
_Y = const(_X + 34)
print(_X, _Y)
class A:
Z = const(1)
_Z = const(2)
print(Z, _Z)
print(hasattr(A, 'Z'), hasattr(A, '_Z'))
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/stduino/circuitpython.git
git@gitee.com:stduino/circuitpython.git
stduino
circuitpython
circuitpython
master

Search