2021-01-17 08:29:18 -05:00
|
|
|
# test for native for loops
|
2014-05-07 18:27:45 -04:00
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
|
2014-05-07 18:27:45 -04:00
|
|
|
@micropython.native
|
|
|
|
def f1(n):
|
|
|
|
for i in range(n):
|
|
|
|
print(i)
|
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
|
2014-05-07 18:27:45 -04:00
|
|
|
f1(4)
|
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
|
2014-05-07 18:27:45 -04:00
|
|
|
@micropython.native
|
|
|
|
def f2(r):
|
|
|
|
for i in r:
|
|
|
|
print(i)
|
|
|
|
|
2020-03-22 22:26:08 -04:00
|
|
|
|
2014-05-07 18:27:45 -04:00
|
|
|
f2(range(4))
|