tests/cpydiff: Add CPy diff test for assignment expression behaviour.

pull/4908/head
Damien George 2020-06-16 21:42:52 +10:00
rodzic e0fe8ea644
commit a3c89cf907
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,7 @@
"""
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)])