1 parent 7cf446f commit 63f4710Copy full SHA for 63f4710
1 file changed
tests/cpydiff/builtin_next_arg2.py
@@ -0,0 +1,12 @@
1
+"""
2
+categories: Modules,builtins
3
+description: Second argument to next() is not implemented
4
+cause: MicroPython is optimised for code space.
5
+workaround: Instead of `val = next(it, deflt)` use::
6
+
7
+ try:
8
+ val = next(it)
9
+ except StopIteration:
10
+ val = deflt
11
12
+print(next(iter(range(0)), 42))
0 commit comments