Re: [Datetime-SIG] Another round on error-checking
On Tue, Sep 1, 2015 at 12:58 PM, Guido van Rossum <guido@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.
participants (1)
-
Alexander Belopolsky