I wonder why f'{None}_some_string'
not throw an error?
Here is some example to reproduce the problem:
s1 = None # <class 'NoneType'>
s2 = 'real_string' # <class 'str'>
s1 + s2 # TypeError: unsupported operand type(s) for +: 'NoneType' and 'str
f'{s1}_bla'
'None_bla'
f'{s2}_bla'
'real_string_bla'
Is it possible to make expressions like f'{s}_some_string'
throw an error when s
is None
?