[Datetime-SIG] Conversion vs arithmetic (was Re: Is EDT a timezone? Was: PEP-0500)

Tim Peters tim.peters at gmail.com
Mon Aug 24 20:36:28 CEST 2015


[ISAAC J SCHWABACHER <ischwabacher at wisc.edu>]
> People keep talking about infinite regress, but I don't think
> there's a problem there at all because in the internals of the
> time zone conversion, you can strip off the time zone before
> doing arithmetic. Am I missing something here?

Yes:  magic doesn't exist in the real world ;-)  All places relying on
classic arithmetic _could_ be repaired if timeline arithmetic were
made mandatory, but finding them would require an exhaustive expert
audit of all instances of aware-datetime arithmetic in all the world's
code.  It only requires finding one such instance to prove that code
_would_ break if the default were changed.  I didn't look for one - I
just happened to notice one in .astimezone().    I have no idea how
many such places Lennart found across the 2+ years PEP 431 was
struggling to finish (but I also have no idea about the _details_ of
the problems Lennart hit).


More information about the Datetime-SIG mailing list