2017-11-27 23:50:53 +00:00
|
|
|
"""
|
|
|
|
categories: Modules,builtins
|
|
|
|
description: Second argument to next() is not implemented
|
|
|
|
cause: MicroPython is optimised for code space.
|
2017-12-03 13:32:09 +00:00
|
|
|
workaround: Instead of ``val = next(it, deflt)`` use::
|
2017-11-27 23:50:53 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
val = next(it)
|
|
|
|
except StopIteration:
|
|
|
|
val = deflt
|
|
|
|
"""
|
|
|
|
print(next(iter(range(0)), 42))
|