[Python-ideas] Infinite in Python (not just in datetime) (original) (raw)

Chris Barker chris.barker at noaa.gov
Mon Feb 2 17:45:01 CET 2015


On Mon, Feb 2, 2015 at 7:27 AM, Thomas Güttler <guettliml at thomas-guettler.de

wrote:

Infinite what?

Integer

Well, inf is supported in floats because it is supported in the native machine double. I suspect that adding inf and -inf (and NaN) to integers would end up being a pretty heavy-weight addition.

On the other hand, my quicky off the cuff implementation of InfDateTime is, in fact, a universal infinity -- i.e. it compares as greater than any other object, not just a datetime object. I did that more because it was easy than anything else, but perhaps it could be generally useful to have a Inf and -Inf object, kind of like None.

Or it would just create a huge set of confusing corner cases :-)

I would much rather see a infinite datetime object that a big discussion about the implications of a generic infinite object -- it is focused, has proven used cases, and wouldn't impact anything beyond datetime.

-Chris

--

Christopher Barker, Ph.D. Oceanographer

Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker at noaa.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150202/d0fd6274/attachment.html>



More information about the Python-ideas mailing list