Message106971
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. |
|
Date |
User |
Action |
Args |
2010-06-03 18:46:35 | belopolsky | set | recipients:
+ belopolsky, doerwalter, brett.cannon, ggenellina, pitrou, vstinner, ajaksu2, kawai, eric.araujo, rafe |
2010-06-03 18:46:34 | belopolsky | set | messageid: <1275590794.55.0.501110507148.issue5094@psf.upfronthosting.co.za> |
2010-06-03 18:46:32 | belopolsky | link | issue5094 messages |
2010-06-03 18:46:32 | belopolsky | create | |
|