[Datetime-SIG] Another round on error-checking

Chris Barker chris.barker at noaa.gov
Fri Sep 4 00:51:30 CEST 2015


On Thu, Sep 3, 2015 at 8:56 AM, Tim Peters <tim.peters at gmail.com> wrote:

> > And intentional or not, "classic" arithmetic may be easy to implement
> > and fast, but it is hard to explain, surprising, and not very useful.
>


> <snip>
>


>  As to being hard to explain,
> you must be joking:


sigh. Look at the length of this stinking thread! and how much confusion
there was at the beginning about what the heck the current datetime
implementation actually did. Classic arithmetic may well be the best
possible solution given the constraints, but it is not obvious, clear,
lacking in surprises or well documented ( and no one reads docs until they
run into a problem)

I know I only got it when someone explained the implementation:

"remove the tzinfo object, do the math, tack the tzinfo back on"

Simple elegant, and now I get it. And get why things go wonky with
datetimes with two different tzinfo objects.

By the way, something like that should be in the docs.

Anyway, clearly timeline math is an important use case for folks -- just as
many (more?) than classic math. It would be nice to support it one way or
another.

Which can have nothing to do with this PEP -- so carry one.

-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/datetime-sig/attachments/20150903/a5f788be/attachment.html>


More information about the Datetime-SIG mailing list