QUERY · ISSUE
RFC: MICROPY_PY_BUILTINS_NEXT2 always set to (0) ?
rfc
Current settings for all ports break cpython script compatibility on next()
https://docs.python.org/3.5/library/functions.html#next
because
MICROPY_PY_BUILTINS_NEXT2 is never defined to 1 except in coverage and defaults to 0
https://github.com/micropython/micropython/blob/master/py/mpconfig.h#L910
CANDIDATE · PULL REQUEST
RFC py: Support builtin next() with 2 arguments
This is a pretty convenient oneliner (to replace 4 lines otherwise) which I miss in uPy. Couple of questions:
- made it optional with MICROPY_PY_BUILTINS_NEXT2, is that name ok, or should that just go under MICROPY_CPYTHON_COMPAT?
- mp_builtin_next is still used for implementing
__next__with the side effect thatiter([]).__next__(1)now suddenly works, not sure if this is acceptable? And if so this should this be in a seperate cpydiff test probably? - ok to enable this by default for unix/windows?