On 27 July 2015 at 17:30, Lennart Regebro <regebro at gmail.com> wrote: >> Apologies for asking yet another dumb question about this, but I have >> the impression that a lot of other people are struggling with the basics >> here too. >> >> Can you tell us which of the two operations datetime currently >> implements? > > It's intended that the first one is implemented, meaning that > datetime.now() + timedelta(hours=24) can result in a datetime > somewhere between 23 and 25 hours into the future. Or well, any > amount, in theory, I guess some changes are more than an hour, but > that's very unusual. Maybe that's what the PEP intends. But the stdlib as currently implemented simply adds the appropriate number to the relevant field (i.e., "increase the hour count with one"). It's not possible to detect the difference between these two using only stdlib timezones, though, as those are all fixed-offset. Both Tim and I have pointed out that Guido's original intention was precisely what is implemented, for better or worse. What Guido's view was on DST-aware timezones and whether the behaviour was appropriate for those, I don't know personally (maybe Tim does). It may well be that it was "let's not think about it for now". If we can ever straighten out what the question is, maybe Guido can chip in and answer it :-) Paul PS Ideally, Guido could pop into his time machine and fix the whole issue at source. But apparently he can't, because the time machine isn't DST-aware...
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