circuitpython/tests/micropython/viper_cond.py
Damien George 6f81348fa2 py: Allow viper to use ints as direct conditionals in jumps.
Allows things like: if 1: ...
2014-09-29 19:42:06 +01:00

16 lines
216 B
Python

# using a bool as a conditional
@micropython.viper
def f():
x = True
if x:
print("x", x)
f()
# using an int as a conditional
@micropython.viper
def g():
y = 1
if y:
print("y", y)
g()