[issue3249] bug adding datetime.timedelta to datetime.date

Tim Peters report at bugs.python.org
Tue Jul 1 17:26:15 CEST 2008


Tim Peters <tim.peters at gmail.com> added the comment:

This isn't "a bug", since it's functioning as documented and designed.
Read note 1 in the "date Objects" section of the reference manual,
explaining the meaning of "date2 = date1 + timedelta":

"""
date2 is moved forward in time if timedelta.days > 0, or backward if
timedelta.days < 0. Afterward date2 - date1 == timedelta.days.
timedelta.seconds and timedelta.microseconds are ignored. OverflowError
is raised if date2.year would be smaller than MINYEAR or larger than
MAXYEAR.
"""
).

You could call this a feature request instead, but an incompatible
change to documented always-worked-this-way behavior is unlikely to be
accepted.

----------
nosy: +tim_one

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3249>
_______________________________________


More information about the Python-bugs-list mailing list