On Thu, Apr 16, 2009 at 5:16 AM, Dirkjan Ochtman <dirk...@ochtman.nl> wrote:
> On Thu, Apr 16, 2009 at 11:54, Amaury Forgeot d'Arc <amaur...@gmail.com> 
> wrote:
>> In my opinion:
>> arithmetic with months is a mess. There is no such "month interval" or
>> "year interval" with a precise definition.
>> If we adopt some kind of month manipulation, it should be a function
>> or a method, like you would do for features like last_day_of_month(d),
>> or following_weekday(d, 'monday').
>>
>>    date(2008, 1, 30).add_months(1) == date(2008, 2, 29)
>
> I concur. Trying to shoehorn month arithmetic into timedelta is a
> PITA, precisely because it's somewhat inexact. It's better to have
> some separate behavior that has well-defined behavior in edge cases.

This is my experience also, and including a distinct and well-defined
behavior in the core is exactly my intention with this patch.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to