[Python-ideas] [Python-Dev] Issue5434: datetime.monthdelta

Jess Austin jess.austin at gmail.com
Fri Apr 17 01:32:10 CEST 2009

On Thu, Apr 16, 2009 at 5:41 PM, Chris Rebert <pyideas at rebertia.com> wrote:
> You might want to look at this recent thread on the issue:
> http://mail.python.org/pipermail/python-list/2009-March/704921.html
> Apologies if it's already been mentioned on -dev; I don't subscribe to it.

Haha, and up until now I haven't subscribed to -ideas.  It seemed the
main complaint in the previous thread was that there are different
ways to handle the corner case of the end of the month, and we
certainly can't just choose one way.

My take on that is that if you want an exception for invalid dates,
use date.replace().  If you want an exact number of days offset, use
timedelta.  If you want the same date, some number of months offset,
while month-end issues are silently handled, you can use the
monthdelta patch I have at http://bugs.python.org/issue5434 and
introduce at http://mail.python.org/pipermail/python-dev/2009-April/088794.html

I'm also aware of dateutil, but in its current form it couldn't be
integrated into core as "batteries included".  IMHO dateutil isn't as
pythonic as it could be either.  My philosophy when designing this was
to be as much like timedelta (which I think is a super API) as


More information about the Python-ideas mailing list