
If you and Cade want to co-author a PEP that adds `inf` and `nan` to the builtins, I'll sponsor it, so you can have a fair hearing from the SC. I won't argue in favor, but not against either.) On Tue, Sep 8, 2020 at 6:26 PM Christopher Barker <pythonchb@gmail.com> wrote:
Thanks Jon and Chris. But I'm not looking to make a literal_eval or custom reprs that support inf and nan -- I may need that some day, so thanks for the tips, but the idea here is to do that little bit more to make Python better support the float special values out of the box.
It seems that moving math,inf and math.nan to __builtins__, and adding them to a "whitelist" in literal_eval (and maybe another place or two?) would accomplish this. Small benefit, yes, but I have yet to hear anyone present a downside (other than the usual it's work that someone has to do).
I took another look at PEP 754 (which was rejected due to disinterest, not because it was determined to be a bad idea), and note that the only part that wasn't implemented was the creation of "constants" in __builtins__ (and, indeed, the PEP is not clear on whether it was suggesting that they be in __builtins__ at all). The PEP also called for different names, and a constant for negative Infinity, which doesn't seem very useful when you can just use a negative sign.
Anyway, I'm done now -- there hasn't been any interest from core devs, and I don't care enough to push this, but it would be nice.
-CHB
-- Christopher Barker, PhD
Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython _______________________________________________ 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/4VK6ND... Code of Conduct: http://python.org/psf/codeofconduct/
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>