4 ms·
For me, the hugs thing about f-strings was that invalid string format characters become a compile time error (SyntaxError). print('I do not get executed :)')
by lewiscollard 7y ago
For me, the hugs thing about f-strings was that invalid string format characters become a compile time error (SyntaxError).
print('I do not get executed :)')
f'{!}'
File "stefco.py", line 2
f'{!}'
^
SyntaxError: f-string: empty expression not allowed
This has the pleasing characteristic of eliminating an entire class of bug. :)