>>> https://github.com/abalkin/cpython/commit/54d3596b0180512c68c91e8308665c0a9e61c9eb
[Tim] >> Wondering whether this line: >> >> if probe2 != result + trans: >> >> could be replaced with: >> >> if probe2 == result: [Alex] > Yes, it can. Thanks for the suggestion. Good! So you have a simple, cross-platform solution now, at least for timestamps localtime() doesn't barf on. > The only assumption that it requires is that no fold is bigger than 24 hours. Well, it does rely on more than just that. For example, if there's a gap where the clock jumps from 2 to 3, followed soon after by a fold of an hour repeating times of the form 4:MM, then the second occurrence of 4:30 won't be detected as such.- the fold and the gap "cancel out" with respect to subtracting 24 hours in either naive time or timestamp time. So it seems a sufficient condition is that there's at most one UTC offset change in the last 24 hours. I wouldn't be surprised if that's always true now - or that it won't be after Kim Jong-un learns he could annoy us by making it false ;-) _______________________________________________ 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/
