Are you familiar with the f-string self-documentation operator in python 3.8?

https://docs.python.org/3/whatsnew/3.8.html#f-strings-support-for-self-documenting-expressions-and-debugging

With it you can say:

print(f"{a==b=}")


---
Ricky.

"I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler


On Mon, Nov 1, 2021 at 10: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.


_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/NQ6NZIALIVNNVMYZSSFF7Y2Q4W736O7L/
Code of Conduct: http://python.org/psf/codeofconduct/