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()`
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)