[Datetime-SIG] Another round on error-checking
Alexander Belopolsky
alexander.belopolsky at gmail.com
Tue Sep 1 19:13:04 CEST 2015
On Tue, Sep 1, 2015 at 12:58 PM, Guido van Rossum <guido at python.org> wrote:
> And given that we already have total ordering problems, from that
> perspective I could live with declaring that two datetimes that differ only
> in the fold are unequal. (Hm, aren't they already unequal because their
> utcoffset() differs?)
They are not unequal because their tzinfos are the same. In this case
__sub__ (and as a consequence __eq__) does not call utcoffset() to follow
the rules of classic arithmetic. My new suggestion is to use timeline
arithmetic whenever fold=1 datetime instance is involved. This should not
break any programs that don't encounter fold=1 instances and in effect will
make fold=1 instances behave similar to how their timezone.utc equivalents
behave now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150901/d093d7ea/attachment-0001.html>
More information about the Datetime-SIG
mailing list