[Python-Dev] PEP 431 Time zone support improvements - Update

Lennart Regebro regebro at gmail.com
Tue Jan 8 19:08:08 CET 2013


On Fri, Dec 28, 2012 at 10:12 PM, Ronald Oussoren <ronaldoussoren at mac.com>wrote:

>
> On 28 Dec, 2012, at 21:23, Lennart Regebro <regebro at gmail.com> wrote:
>
> > Happy Holidays! Here is the update of PEP 431 with the changes that
> emerged after the earlier discussion.
>
> Why is the new timezone support added in a submodule of datetime? Adding
> the new
> function and exception to datetime itself wouldn't clutter the API that
> much, and datetime
> already contains some timezone support (datetime.tzinfo).


Putting the API directly into the datetime module does conflict with the
new timezone class from Python 3.2. The timezone() function therefore needs
to be called something else, or the timezone class must be renamed.

Alternative names for the timezone() function is get_timezone(), which has
already been rejected, and zoneinfo() which makes it clear that it's only
zoneinfo timezones that are relevant.
Or the timezone class get's renamed TimeZone (which is more PEP8 anyway).

We can allow the timezone() function to take both timezone(offset, [name])
as now, and timezone(name) and return a TimeZone object in the first case
and a zoneinfo based timezone in the second case.

Or maybe somebody else can come up with more clever options?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130108/729f8201/attachment.html>


More information about the Python-Dev mailing list