Re: [Datetime-SIG] What's are the issues?
On Tue, Jul 28, 2015 at 6:43 PM, Chris Angelico <rosuav@gmail.com> wrote: What if the existing timedelta is left as-is, and a new calendardelta
type is introduced? Instead of folding everything down to a simple microsecond count, it would retain the exact values it was given,
sure -- that would be one way to do it -- maybe good way. But it would be a lot more complicated than just keeping days. Lots to hash out for API and functionality at the corner cases (the old what's one year after Feb 29th? kinds of questions)
When you add a calendardelta to an aware datetime, it performs what you're describing as calendar arithmetic,
actually, no reason you couldn't do calendar manipulations on naive datetimes, too (they wouldn't get any ugly DST issues, but otherwise the same). One reason I don't like calling the arithmetic naive or not....
adding calendardelta(days=1) would never affect the hour/minute/second shown, unless it would otherwise create an illegal time.
exactly -- all those corner cases would need to be worked out. -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 Chris.Barker@noaa.gov
participants (1)
-
Chris Barker