[Python-Dev] Status on PEP-431 Timezones
Tim Peters
tim.peters at gmail.com
Mon Jul 27 21:14:06 CEST 2015
....
>>> The "days" attribute here is indeed confusing as it doesn't mean 1 day,
>>> it means 24 hours.
>> Which, in naive arithmetic, are exactly the same thing.
[Terry Reedy]
> I think using the word 'naive' is both inaccurate and a mistake. The issue
> is civil or legal time versus STEM time, where the latter includes
> applications like baking cakes.
Sorry, never heard of "STEM time" before - & a quick Google search didn't help.
> It could also be called calendar time versus elapsed time. (Financial/legal
> arithmetic versus STEM arithmetic is a somewhat similar contrast.)
And I am, alas, equally unclear on what any of those others mean
(exactly) to you.
> The idea that an hour can be sliced out of a somewhat random March day and
> inserting it into a somewhat random October day is rather sophisticated. It
> came from the minds of government bureaucrats. It might be smart, dumb, or
> just a cunning way for civil authorities to show who is in charge by making
> us all jump. But not 'naive'.
I agree. Python's "naive time" single-timezone arithmetic
intentionally ignores all that: it ignores leap seconds, it ignores
DST transition points, it ignores governments deciding to change the
base UTC offset within a pre-existing time zone, ... It's time soooo
naive that it thinks 24 hours is the same thing as a day ;-)
> 'Naive' means simple, primitive, or deficient in informed judgement. It is
> easy to take it as connoting 'wrong'.
While some people in this thread seem convinced Python's naive time
_is_ "wrong", it's not because it's called "naive". In any case,
Guido decided to call it "naive" over 13 years ago, starting here, and
that terminology has been in use ever since:
https://mail.python.org/pipermail/python-dev/2002-March/020648.html
> Tim, you have been arguing that civil/legal time arithmetic is not naive.
Yes. But that's not "an argument", it's a plain fact that Python's
"naive time" (note that "naive" here is technical term, used widely in
the datetime docs) is not civil/legal time (assuming I understand what
you mean by that phrase).
> Calling civil time naive undercuts this claim.
I don't see that I ever said civil time is naive. Adding a day is
_not_ always the same as adding 24 hours in (at least Lennart's
beliefs about) civil time. They _are_ always the same in Python's
("naive") datetime arithmetic. And the latter is all I said in the
quote at the top of this msg.
What am I missing? It's always something ;-)
More information about the Python-Dev
mailing list