[Datetime-SIG] PEP 495 (Local Time Disambiguation) is ready for pronouncement

Tim Peters tim.peters at gmail.com
Sun Aug 16 23:16:55 CEST 2015


[Guido]
> ...
> - Would there be any merit in proposing, together with the idea of a
> three-value flag, that datetime arithmetic should use "timeline arithmetic"
> if the flag is defined and a tzinfo is present?

It's worth considering.  At the highest level, this requires:

1. Answering whether "timeline arithmetic" does or does not account
for gaps and folds due to leap seconds too.

2. Supplying a feasible path for those who insist the other answer is
the only acceptable one ;-)

The way things have gone so far, the current PEP was meant to be a
"baby step" along the way, and PEP 500 goes on to refuse to even ask
#1, instead addressing #2 (tzinfo objects will grow ways to take over
datetime arithmetic, in any damn fool ;-) way they like).

But if "timeline arithmetic" comes built in, #1 has to be answered up
front - and I wouldn't be surprised then if PEP 500 died, leaving the
#1 "losers" wholly devoid of hope.

Which I take kinda seriously ;-)

- It's nuts to add a minute to a UTC datetime and see the seconds
change ("leap seconds are insane").

- It's also nuts to subtract two UTC datetimes a minute apart and not
get the actual number of seconds between them in the real world ("leap
seconds are vital").

The advantage of the current approach is that it leaves both camps
equally empowered - and equally challenged - to scratch their own
itches.

That's the political answer.  As always, I'll leave the tech stuff to
you eggheads ;-)


More information about the Datetime-SIG mailing list