On Tue, Nov 2, 2021 at 1:31 PM Evan Greenup via Python-ideas
<[email protected]> 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
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/CLZW3YH2EHP2VMRWIDH7NA7LE4PYXPYL/
Code of Conduct: http://python.org/psf/codeofconduct/