[Datetime-SIG] Another round on error-checking

Tim Peters tim.peters at gmail.com
Thu Sep 3 02:48:54 CEST 2015


[Tim]
>> There are still questions, like, e.g., what
>>
>>     fold_aware_datetime + timedelta
>>
>> should do when fold=1, but only in my variation of what you proposed.
>> You proposed mixing "pay attention to fold" with "timeline
>> arithmetic", which leaves no choice.  Alex and I seem to disagree
>> about what to do when "only pay attention to fold" is meant instead.

[Alex]
> This is one of those cases where I don't have a strong opinion.

I do:  it should ignore fold=1.  Precisely the opposite of what you
_thought_ I've been saying ;-)


> Unlike the datetime - datetime case where we have a strong argument
> to do timeline arithmetic in the presence of fold=1 (namely to preserve
> the hash invariant),

And total ordering, and equivalence between comparison outcomes and
subtraction results.  There are any number of "common sense"
invariants that rely on this.

> any choice here will lead to surprises.

Indeed so.  So screw it ;-)

> ...


More information about the Datetime-SIG mailing list