[Python-Dev] Status on PEP-431 Timezones

Tim Peters tim.peters at gmail.com
Mon Jul 27 21:23:50 CEST 2015


[Tim]
>> But it's a fact that they _are_ the same in naive time, which Python's
>> datetime single-timezone arithmetic implements:
>>
>> - A minute is exactly 60 seconds.
>> ...

[Chris Angelico <rosuav at gmail.com>]
> No leap second support, presumably. Also feature?

Absolutely none, and absolutely "a feature", but that didn't start
with the datetime module.  Read Guido's original 13+ year old message
about "naive time":

https://mail.python.org/pipermail/python-dev/2002-March/020648.html

Note especially this part:

"""
I'm thinking that for most *business* uses of date and time, we should
have the same attitude towards DST that we've already decided to take
towards leap seconds.
"""

Guido has never had the slightest use for leap seconds in any part of
Python's implementation, and has consistently opposed attempts to
incorporate them.  This was well established long before datetime was
even an idea.

Here's another, later quote from him:

"""
Python's datetime objects will not support leap seconds in any way,
shape or form.  A tzinfo object that does support leap seconds is on
its own, but I don't see the point since Python will never represent a
time as a number of seconds since some epoch.  (If you want to get a
POSIX time_t value, you'll have to convert first to local time, then
to a struct tm, and then use mktime().)
"""


More information about the Python-Dev mailing list