[Datetime-SIG] Another round on error-checking
alexander.belopolsky at gmail.com
Tue Sep 1 02:25:36 CEST 2015
On Mon, Aug 31, 2015 at 8:16 PM, Alexander Belopolsky <
alexander.belopolsky at gmail.com> wrote:
> Sorry, but PEP 495 has never promised you that: "instances that differ
> only by the value of fold will compare as equal. Applications that need to
> differentiate between such instances should check the value of fold or
> convert them to a timezone that does not have ambiguous times."
When I was writing some early drafts, I thought about advising users to use
(local_datetime, local_datetime.fold) pairs as dictionary keys, but decided
not to because using local_datetime.astimezone(timezone.utc) is a much
better option. Now I think such advise may be relevant if a user truly has
a need to sort out timestamps that come from many different timezones and
for some reason wants to avoid conversion to UTC, but I don't think it will
belong to the PEP.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Datetime-SIG