lv_micropython/tests/basics/string_fstring_invalid.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
316 B
Python
Raw Normal View History

# PEP-0498 specifies that '\\' and '#' must be disallowed explicitly, whereas
# MicroPython relies on the syntax error as a result of the substitution.
print(f"\\")
print(f"#")
try:
eval("f'{\}'")
except SyntaxError:
print("SyntaxError")
try:
eval("f'{#}'")
except SyntaxError:
print("SyntaxError")