[Datetime-SIG] PEP-431/495

Akira Li 4kir4.1i at gmail.com
Mon Aug 31 12:42:16 CEST 2015


Tim Peters <tim.peters at gmail.com> writes:

> [Akira Li <4kir4.1i at gmail.com>]
> ...
>> then arithmetic "as though via conversion to utc time" is *equally valid* as
>> the arithmetic "as though it is a timezone-naive datetime object".aa
>
>  __add__ can only mean one of them.  And it already does.  It _could_
> have meant the other, but it doesn't.
>

In fact, it does mean the other:
https://mail.python.org/pipermail/datetime-sig/2015-August/000545.html

stdlib is consistent with pytz (utc arithmetic). dateutil (naive) produces
different results.

...
>> Timezones is a very complicated
>> topic -- no solution works in the general case.a
>
> ?  Timezone transitions are mathematically trivial.  They're just full
> of lumps (irregularities).
>

Irregularity is another word for complexity.  Timezone rules are defined
by politicians. Even if they appear to be simpletons; it is still hard
to create a math equation that will predict the rules. Instead, the
*database* approach with regular updates works well in practice.



More information about the Datetime-SIG mailing list