On 21 August 2015 at 23:59, Alexander Belopolsky <[email protected]> wrote: > > On Fri, Aug 21, 2015 at 8:07 AM, Stuart Bishop <[email protected]> > wrote: >> >> - The rules in PEP-495 for utcoffset() and dst() to deal with >> ambiguous times only work in simple cases, as there dst offsets both >> more and less than 1 hour, and there is no stdoffset since the offset >> can change at the same time (eg. Europe/Vilnius 1941, where the clocks >> ended up going backwards for summer time instead of forwards). > > > Instead of engaging in a theoretical discussion, I went ahead and added this > transition as a test case to my reference implementation. Please review [1] > and let me know if you see any issues. > > [1]: > https://github.com/abalkin/cpython/commit/9f683c8d0f6f2b48aad81ae4e5e8a118a542d2d4
Seems fine. If you want more amusing test cases, the ones I have tripped over are in http://bazaar.launchpad.net/~stub/pytz/devel/view/head:/src/pytz/tests/test_tzinfo.py. I think the one least likely to be covered is Pacific/Apia (Samoa) in 2011, when they jumped the international dateline. No dst transition, but the offset changed from -10 to +14 and they skipped Dec 30th entirely. -- Stuart Bishop <[email protected]> http://www.stuartbishop.net/ _______________________________________________ Datetime-SIG mailing list [email protected] https://mail.python.org/mailman/listinfo/datetime-sig The PSF Code of Conduct applies to this mailing list: https://www.python.org/psf/codeofconduct/
