[Datetime-SIG] A local timezone class

Guido van Rossum guido at python.org
Sat Aug 29 02:06:10 CEST 2015


On Fri, Aug 28, 2015 at 4:58 PM, Alexander Belopolsky <
alexander.belopolsky at gmail.com> wrote:

>
> On Fri, Aug 28, 2015 at 7:51 PM, Guido van Rossum <guido at python.org>
> wrote:
>
>> On Fri, Aug 28, 2015 at 6:53 PM, Guido van Rossum <guido at python.org>
>>> wrote:
>>>
>>>> I'm not entirely sure why we didn't add this to the stdlib ages ago.
>>>
>>>
>> But (as my base class shows) implementing the required API using only the
>> tm_isdst flag and the timezone-related attributes of the time module
>> (tzname, timezone, altzone) a satisfactory implementation can be obtained,
>> and that API has been stable since the beginning of time.
>>
>
> To be fair, we did ship something very similar, but it was only accessible
> to users who read the library manual: <
> https://hg.python.org/cpython/file/v3.5.0rc2/Doc/includes/tzinfo-examples.py#l54>.
> :-)
>

So, again, why have we been shy of adding this to the stdlib? We did
(eventually) add the fixed offset classes. (And before you say "for the
same reason we didn't add the USTimeZone class", the reasons can't be the
same -- the latter would require maintenance whenever the US changes its
DST rules, while LocalTime is oblivious to all that.)

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150828/d1beb60c/attachment.html>


More information about the Datetime-SIG mailing list