[Datetime-SIG] Conversion vs arithmetic (was Re: Is EDT a timezone? Was: PEP-0500)

Carl Meyer carl at oddbird.net
Tue Aug 25 02:15:34 CEST 2015


On 08/24/2015 05:50 PM, Tim Peters wrote:
> [ijs]
>>>>> I see how PEP 495 makes it possible to convert datetimes correctly
>>>>> in all cases,
> 
> [Tim]
>>>> Whew!  You may well be only the second person to grasp this - thanks :-)
> 
> [ijs]
>>> Wait... was this ever in contention?
> 
> [Carl Meyer]
>> I don't think so. I'm not sure what Tim is referring to here; I haven't
>> seen any messages in this thread that indicated a lack of understanding
>> on this point.
> 
> I've lost track of how often I've explained it.  That suggests it's
> not being understood.  Start with the message at the top of _this_
> (renamed) thread, which was posted today, so it shouldn't fade
> entirely from memory for at least another 37 minutes ;-)

Fair enough :-) I can't seem to find Stuart's message that you were
replying to, but my (sometimes failing) memory thought it was more of a
design justification of pytz (in a non-PEP-495 world) than a critique of
PEP 495.

In any case, since I've argued several times that naive arithmetic on
aware datetimes is wrong, I'll be crystal clear: I don't think there's
any question that it is possible to make conversions unambiguous without
changing how datetime arithmetic works, and that PEP 495 achieves that much.

My only quibbles about PEP 495 are minor ones: naming, API convenience
for "strict mode", and the fact that it won't help me, because until we
do change the arithmetic, I'll keep on using pytz and its fixed-offset
tzinfo objects :-)

Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/datetime-sig/attachments/20150824/aa26070d/attachment-0001.sig>


More information about the Datetime-SIG mailing list