QUERY · ISSUE
Unix: initialisation of multi-line dict can report wrong line number for syntax error.
The following:
a = {
'one' : 1,
'two' : 2,
'three' : 3,
'four', 4 # error
}
produces the following outcome:
MicroPython v1.8.7-893-g46b849a on 2017-06-22; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> import rats35
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "rats35.py", line 2, in <module>
SyntaxError: expecting key:value for dict
>>>
CANDIDATE · ISSUE
Concatenation of f-strings throws syntax error
From this forum thread - ignore incorrect title:
x = 1
y = 2
f"{x}" f"{y}"
On CPython this produces 12. On MicroPython Unix build:
MicroPython v1.17 on 2021-09-02; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> x = 1
>>> y = 2
>>> f"{x}" f"{y}"
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>>