On 08/18/2015 12:09 PM, Ethan Furman wrote:
On 08/18/2015 11:41 AM, Alexander Belopolsky 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.
I don't understand this. In the PEP it says:
An instance that has first=False in a non-ambiguous case is said to represent
an invalid time (or is invalid for short), but users are not prevented from
creating invalid instances by passing first=False to a constructor or to a
replace() method.
and later
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?
Ah, puzzling through the PEP again I think you just left off the `.timestamp()`
from those two pieces.
--
~Ethan~
_______________________________________________
Datetime-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/datetime-sig
The PSF Code of Conduct applies to this mailing list:
https://www.python.org/psf/codeofconduct/