On 7/27/2015 3:09 AM, Tim Peters wrote: > [Paul Moore <p.f.moore at gmail.com>] >>> .... >>> As an example, consider an alarm clock. I want it to go off at 7am >>> each morning. I'd feel completely justified in writing >>> tomorrows_alarm = todays_alarm + timedelta(days=1). > > [Lennart Regebro <regebro at gmail.com>] >> That's a calendar operation made with a timedelta. > > It's an instance of single-timezone datetime arithmetic, of the > datetime + timedelta form. Your examples have been of the same form. > Note that after Paul's > > tomorrows_alarm = todays_alarm + timedelta(days=1) > > it's guaranteed that > > assert tomorrows_alarm - todays_alarm == timedelta(days=1) > > will succeed too. > >> 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. 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. It could also be called calendar time versus elapsed time. (Financial/legal arithmetic versus STEM arithmetic is a somewhat similar contrast.) 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'. 'Naive' means simple, primitive, or deficient in informed judgement. It is easy to take it as connoting 'wrong'. Tim, you have been arguing that civil/legal time arithmetic is not naive. Calling civil time naive undercuts this claim. -- Terry Jan Reedy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4