Thanks Felipe -- nice and concise and clear!

A couple notes:

* "local/naive" datetime (no tzinfo) + timedelta is period arithmetic,
> where timedelta is a restricted form of period that supports only days,
> hours, minutes, seconds, and milliseconds. (Which is equivalent to
> mixed-radix seconds, as Tim has pointed out)
>

With a naive datetime, doesn't this also mean timedelta supports Duration
arithmetic? without any DST uglyness, they are the same thing, at least
with well defined units like days. At least I've used it this way for
years, with no noticed ill effects. Have I just been lucky?


> * "aware" datetime (with tzinfo) + timedelta is sort of like period
> arithmetic, though Noda doesn't define this operation. It is equivalent to:
> 1) remove the tzinfo to get a local/naive dt 2) perform period arithmetic
> 3) attach the tzinfo again to get an aware dt.
>

We need to add some text along these lines to the docs -- that would have
helped a lot.


> I'm fine extending the Noda definition of "period arithmetic" to cover
> this case
>

Is it really different than Period Arithmetic that only support units of
days? Anyway, not a distinction that matters.

 I am very much +1 for this idea, and will write up a Duration object in
> the next couple of days
>

great -- would it:

Convert to UTC
Do the math
Convert back to local time zone?

Or is there another way to handle it?

-Chris




-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]
_______________________________________________
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