I have received a python notebook that is full of expressions like f"{expr=}"
that in my environment produce error messages:
var=7
print(f"{var=}")
File "<fstring>", line 1
(var=)
^
SyntaxError: invalid syntax
I suspect/expect that it could be in fact a new syntax for f"expr={expr}"
, i.e. as in the following print statement:
print(f"var={var}")
var=7
In fact I often use expressions like the latter for debug, and it would be nice to have a shorthand for it.
Is that a higher version of python than mine (3.7.6)? Or is it a customization of the fstring
module?
Searching for it on the web or in SE was not productive.
And if it is not a standard feature, how can I get it to work?