On Sat, Aug 22, 2015 at 5:46 PM, Chris Barker <[email protected]> wrote:

> >  gaps
>
>> & folds don't exist in such zones, and classic arithmetic goes much
>> faster than timeline arithmetic).
>>
>
> much faster? isn't it "just a "convert to UTC, do the math, convert back
> to the TZ?" and for the "simple" TZs, the convert is an addition or
> subtraction. Is it worth optimizing that out?
>

You under-appreciate how well-optimized datetime arithmetic is in CPython.
Adding/subtracting datetime objects is just 1.5-2x slower than
adding/subtracting integers.  Compared to that, a single call to
.utcoffset() ("even if the function itself is implemented in C") is often
unacceptable overhead.

Note that there are many programs written already that use datetime
arithmetic extensively.  We cannot possibly make them run 10x slower in the
next Python release.
_______________________________________________
Datetime-SIG mailing list
[email protected]
https://mail.python.org/mailman/listinfo/datetime-sig
The PSF Code of Conduct applies to this mailing list: 
https://www.python.org/psf/codeofconduct/

Reply via email to