We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44bcfe5 commit e22c666Copy full SHA for e22c666
tests/cpydiff/syntax_spaces.py
@@ -1,8 +1,15 @@
1
"""
2
categories: Syntax,Spaces
3
-description: uPy requires spaces between literal numbers and keywords, CPy doesn't
4
-cause: Unknown
5
-workaround: Unknown
+description: MicroPython requires spaces between literal numbers and keywords, CPython doesn't
+cause: Different parser implementation
+
6
+MicroPython's tokenizer treats a sequence like ``1and`` as a single token, while CPython treats it as two tokens.
7
8
+Since CPython 3.11, this syntax causes a ``SyntaxWarning`` for an "invalid literal".
9
10
+workaround: Add a space between the integer literal and the intended next token.
11
12
+This also fixes the ``SyntaxWarning`` in CPython.
13
14
15
try:
0 commit comments