On Tue, Nov 2, 2021 at 1:31 PM Evan Greenup via Python-ideas python-ideas@python.org wrote:
It would be nice to add the following syntax sugar in Python "Print and Eval"
like `ptev a == b` It is same as `statement = "a == b"; print(f"{statement} ? {eval(statement)}")`.
It would super nice for debugging and other research project.
At the REPL, that basically already happens, but if this is something you're doing a lot of in your code, you might be able to take advantage of this feature of f-strings:
a = 5 b = 5.0 f"{a == b = }"
'a == b = True'
Very handy for quick debugging.
ChrisA