The `eval(repr(x)) == x` is not a segment of my code; rather it is part of Python's description of what 'repr' should do:
Specifically: ` For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval()` https://docs.python.org/3.4/library/functions.html?highlight=repr#eval
So everyone in this thread can stop mentioning security concerns; I'm sure we're all aware of those and we should instead focus on what repr should do and shouldn't do.
I think it's weird to not fulfill this promise, when it should be easy to do. Further, I agree that 'inf' is: 1. Too backwards incompatible 2. Not the right format for Python (Python likes pascalcase, like `None`, `True`, `False`)
So again, I'd like to not focus on arguing whether a particular codebase should be using 'eval' on strings generated by repr. Rather, my point was that the current behavior does not follow what Python suggests and says 'repr' should do.
---- *Cade Brown* Research Assistant @ ICL (Innovative Computing Laboratory) Personal Email: firstname.lastname@example.org ICL/College Email: email@example.com
On Fri, Sep 4, 2020 at 9:31 PM Greg Ewing firstname.lastname@example.org wrote:
On 5/09/20 10:51 am, Chris Angelico wrote:
If you make "inf" a keyword, then even the Python standard library is broken.
The OP didn't suggest that, he suggested adding a new name such as Infinity that reprs could use.
-- Greg _______________________________________________ Python-ideas mailing list -- email@example.com To unsubscribe send an email to firstname.lastname@example.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://email@example.com/message/TTFTEB... Code of Conduct: http://python.org/psf/codeofconduct/