[Datetime-SIG] PEP 495 (Local Time Disambiguation) is ready for pronouncement

Tim Peters tim.peters at gmail.com
Tue Aug 18 21:06:14 CEST 2015


[Carl Meyer <carl at oddbird.net>]
> `t.replace(later=True) - t.replace(later=False) < 0` certainly seems
> wrong, but why would it be implemented that way?

So that from the two values alone it's possible to distinguish among
the 3 possibilities:  the time is ambiguous, the time is invalid (in a
gap), or the time is ordinary - corresponding to which of  ">", "<",
or "=="  obtains.

I'd probably be happier requiring, e.g., a new `classify()` tzinfo
method to give a direct answer, but that would be a new burden.
Tricking other methods into giving another way to distinguish is at
worst defensible.


More information about the Datetime-SIG mailing list