[Python-ideas] Re: 'Infinity' constant in Python

2020-09-08 Thread Guido van Rossum
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 wrote: > Thanks Jon and Chris. But I'm not looking

[Python-ideas] Re: 'Infinity' constant in Python

2020-09-08 Thread Christopher Barker
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

[Python-ideas] Re: 'Infinity' constant in Python

2020-09-08 Thread Jonathan Crall
Given that this is unlikely to see any change in core Python, perhaps you can get a decent solution with a third party library? If your main issue is that repr doesn't provide an "eval-able" string, then may I suggest using the "most-used" function in the ubelt utility library: ubelt.repr2 Two