[Python-Dev] Status on PEP-431 Timezones

Lennart Regebro regebro at gmail.com
Mon Jul 27 17:21:40 CEST 2015


On Mon, Jul 27, 2015 at 5:12 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> Does thinking of the problem in terms of timedeltas not containing
> enough information to make a_time + a_timedelta a well-defined
> operation if a_time uses a non-fixed-offset timezone, make it any
> easier to find a way forward?

Well, I think it is a well-defined operation, but that datetime
currently does it wrongly, to be honest. Adding 3600 seconds to a
datetime should move that datetime 3600 seconds forward at all time. I
just do not see a usecase for doing anything else, to be honest. But
if somebody has one, I'm all ears.

The problem here is that the issue of "get the next day" has been
mixed into timedeltas, when it in my opinion is an entirely different
issue that should be kept separate from timedeltas.

It is possible to implement something so that you can both have
"realtimedeltas" and "walltimedeltas" where adding one hour might give
you two hours (or an error) but as per above I can't think of a
usecase.

//Lennart


More information about the Python-Dev mailing list