[Datetime-SIG] Another round on error-checking

Tim Peters tim.peters at gmail.com
Tue Sep 1 19:35:23 CEST 2015


[Tim]
>> I can see one kind of annoyance that would remain:
>>
>>     dt2 = dt1 + a_timedelta
>>
>> is currently specified to force dt2.fold==0 even if dt1.fold==1.  But
>> that may not make good sense.

[Alex]
> Note that dt2.fold==0 even if dt1.fold==1 *and* a_timedelta==timedelta(0).

Yup.


> This is what I call "fold-unaware" arithmetic.  It is consistent with
> dt2==dt1.

Heh - setting

    dt2.fold = random.randrange(2)

would also be consistent with dt2 == dt1.  That is, "==" ignores both
`fold`s entirely in this case.


More information about the Datetime-SIG mailing list