This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients ajaksu2, belopolsky, brett.cannon, doerwalter, eric.araujo, ggenellina, kawai, pitrou, rafe, vstinner
Date 2010-06-03.18:46:27
SpamBayes Score 0.0003003968
Marked as misclassified No
Message-id <1275590794.55.0.501110507148.issue5094@psf.upfronthosting.co.za>
In-reply-to
Content
I am attaching the next installment of the datetime.timezone class implementation.

Here I add ``utc`` class attribute to timezone.  I decided to place it in class rather than module namespace because this seems to be more inline with how datetime module defines particular instances of its classes such as ``min``, ``max`` and ``resolution``. I also feel that writing ``timezone.utc`` makes it clearer that its is an instance of ``timezone`` class while ``datetime.UTC`` or simply ``UTC`` is more ambiguous.

I also changed ``timezone`` constructor to interpret int or float offset as number of hours and accept arbitrary timedelta between timedelta(hours=-12) and timedelta(hours=12).  The rationale is that most common timezones have offsets at whole hours and less common but existing timezones use 1/2 or 1/4 hour offsets and thus can be specified as a binary float without any issue.

I've added tests and some preliminary documentation.
History
Date User Action Args
2010-06-03 18:46:35belopolskysetrecipients: + belopolsky, doerwalter, brett.cannon, ggenellina, pitrou, vstinner, ajaksu2, kawai, eric.araujo, rafe
2010-06-03 18:46:34belopolskysetmessageid: <1275590794.55.0.501110507148.issue5094@psf.upfronthosting.co.za>
2010-06-03 18:46:32belopolskylinkissue5094 messages
2010-06-03 18:46:32belopolskycreate