You've already forked Core2forAWS-MicroPython
mirror of
https://github.com/m5stack/Core2forAWS-MicroPython.git
synced 2026-05-20 10:30:31 -07:00
8 lines
342 B
Python
8 lines
342 B
Python
"""
|
|
categories: Syntax,Operators
|
|
description: MicroPython allows using := to assign to the variable of a comprehension, CPython raises a SyntaxError.
|
|
cause: MicroPython is optimised for code size and doesn't check this case.
|
|
workaround: Do not rely on this behaviour if writing CPython compatible code.
|
|
"""
|
|
print([i := -1 for i in range(4)])
|