[Python-Dev] Status on PEP-431 Timezones

Lennart Regebro regebro at gmail.com
Wed Apr 15 21:51:46 CEST 2015


On Wed, Apr 15, 2015 at 3:23 PM, Stuart Bishop <stuart at stuartbishop.net> wrote:
> Huh. I didn't think you would need to change any arithmetic

Not really, the problem is in keeping the date normalized after each
call, and doing so the right way.

> Arithmetic
> remains 'add the timedelta to the naive datetime, and then punt it to
> the tzinfo to make any necessary adjustments' and I thought this would
> not need to be changed at all.

Just punting it to tzinfo to make adjustments, ie effectively just
doing what normalize() does creates infinite recursion as there is
more arithmetic in there, so it's not quite that simple.

> I don't think this can be avoided entirely. Any ideas I can come up
> with that might help are worse than requiring devs to convert their
> datetimes to strings in the rare case they need their 3.5 pickles read
> with 3.4.

Pickle forward compatibility isn't really expected anyway...


More information about the Python-Dev mailing list