[Python-ideas] datetime: Support infinity

Yawar Amin yawar.amin at gmail.com
Wed Jan 28 04:24:10 CET 2015


Hi,

On 2015-01-27 18:04, Chris Barker wrote:
> On Tue, Jan 27, 2015 at 2:47 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> [...]

>     > > Adding infinities to the datetime module would probably be
>     > > possible but
>     > > someone has to figure out the arithmetic rules. Do we need
>     > > "not a time"
>     > > when adding infinity to -infinity?

> not_a_timedelta, I suppose, or simply disallow it.
>
> But if you do allow it -- then following the rules for floating point
> inf, -inf, and NaN would make sense.

Adding datetime.neg_inf() and datetime.pos_inf() should return
datetime.now().

Regards,

Yawar


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150127/df66d5d0/attachment.sig>


More information about the Python-ideas mailing list