[Datetime-SIG] Timeline arithmetic?

Chris Barker chris.barker at noaa.gov
Fri Sep 4 18:01:19 CEST 2015


It seems to me that it's clear that timeline arithmetic will not get
implemented in concert with PEP 495.

So -- is the door open to a PEP that DOES implement timeline arithmetic
with tz-aware datetimes in the standard lib?

I would like a flag on datetime, but it seems it might be better to put
that flag on a tzinfo object. But the implementation is the something to
argue about only if there is any chance of doing it at all.

Also, particularly as PEP 495 will introduce changes to tzinfo, that will
presumable lead to changes in tzinfo implementations (like pytz, etc), it
seems that if other changes are afoot, now is a good time to map out how
they should be done.

Stuart, if you are listening:

IIUC, you want "timeline" arithmetic to work with pytz tzinfo-aware
datetimes. To the extent that the current implementation functions in a
 maybe "hacky", and at least inconvenient, way to achieve this.

So you are an obvious person to say what we might put in the stdlib that
would facilitate cleaning all that up. If anything.

BTW: I'll at least take it as a given that we're not breaking backward
compatibility, and that arithmetic needs to stay as fast as it currently is
-- at least in the cases where it currently works.



Christopher Barker, Ph.D.

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/datetime-sig/attachments/20150904/7fb4c668/attachment.html>

More information about the Datetime-SIG mailing list