[Python-ideas] datetime: Support infinity

Alexander Belopolsky alexander.belopolsky at gmail.com
Tue Jan 27 23:59:13 CET 2015


On Tue, Jan 27, 2015 at 5:47 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> > Adding dates (or datetimes) is not a valid operation today, so I don't
> > see why we would need to change behaviour there.
>
> We're talking about both datetimes and timestamps here. Please follow.


I think Antoine meant "timedeltas".  Having a date infinity necessitates an
infinite timedelta to represent a difference between a finite and an
infinite date.

While we cannot add dates, it is still a valid question what the result of
subtracting an infinite date from itself should be.  If we make it
timedelta(0) then date.inf is not that different from date.max.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150127/115336a4/attachment-0001.html>


More information about the Python-ideas mailing list