[Datetime-SIG] PEP 495 (Local Time Disambiguation) is ready for pronouncement
alexander.belopolsky at gmail.com
Tue Aug 18 21:31:40 CEST 2015
On Tue, Aug 18, 2015 at 3:09 PM, Ethan Furman <ethan at stoneleaf.us> wrote:
> The problem with "hardcoding" the temporal relationship in the name of
>> the flag is that for a missing time `t` you get a counter-intuitive
>> t.replace(later=True) - t.replace(later=False) < 0.
>> The value of "first" will be ignored in all operations except those that
>> involve conversion between timezones.
> So why won't `t.replace(_ltdf=True)` be the same value as
> `t.replace(_ltdf=False)` ? The flag itself would be different, but the
> flag is not consulted for maths operations, right?
I used t.replace(later=True) - t.replace(later=False) < 0 as a shorthand
for t.replace(later=True).timestamp() - t.replace(later=False).timestamp()
< 0. (The 0 in the r.h.s. instead of timedelta(0) could serve as a hint.)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Datetime-SIG