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
Syntax error on F-String?
No idea what's happening.
Feels simple enough that I'm probably doing something obvious wrong, but also simple enough that I can't see what:
MicroPython 4fe0332-dirty on 2021-10-27; linux version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>> f"{5}"
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>> print(f"{5}")
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>> import sys
>>> sys.implementation
(name='micropython', version=(1, 16, 0), mpy=2821)
Don't see anything to explain this in the list of known differences.
I suppose F-Strings are a 3.6 feature, but I assume they're included under the "selected features from later versions"?