summaryrefslogtreecommitdiff
path: root/tests/cpydiff/syntax_assign_expr.py
blob: 58f57ca1fbe0262c32b156f6ed206590d8617b5d (plain)
1
2
3
4
5
6
7
8
"""
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)])