summaryrefslogtreecommitdiffstatshomepage
path: root/tests/pybnative/for.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pybnative/for.py')
-rw-r--r--tests/pybnative/for.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/pybnative/for.py b/tests/pybnative/for.py
new file mode 100644
index 0000000000..309c6c14fd
--- /dev/null
+++ b/tests/pybnative/for.py
@@ -0,0 +1,15 @@
+import pyb
+
+@micropython.native
+def f1(n):
+ for i in range(n):
+ print(i)
+
+f1(4)
+
+@micropython.native
+def f2(r):
+ for i in r:
+ print(i)
+
+f2(range(4))