This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients René Hernández Remedios, martin.panter
Date 2017-05-31.00:08:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496189327.39.0.997090910355.issue30516@psf.upfronthosting.co.za>
In-reply-to
Content
The C "_datetime" implementation seems to handle this as documented. But either way, the "timedelta" range is greater than the "datetime" range, so it seems to be just a difference in OverflowError messages, not a big practical problem:

Python "datetime" implementation:
>>> import sys
>>> sys.modules["_datetime"] = None
>>> from datetime import *
>>> datetime.max - timedelta.max
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Martin\AppData\Local\Programs\Python\Python35-32\lib\datetime.py", line 1741, in __sub__
    return self + -other
  File "C:\Users\Martin\AppData\Local\Programs\Python\Python35-32\lib\datetime.py", line 518, in __neg__
    -self._microseconds)
  File "C:\Users\Martin\AppData\Local\Programs\Python\Python35-32\lib\datetime.py", line 430, in __new__
    raise OverflowError("timedelta # of days is too large: %d" % d)
OverflowError: timedelta # of days is too large: -1000000000

C "_datetime" implementation:
>>> from datetime import *
>>> datetime.max - timedelta.max
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: date value out of range
History
Date User Action Args
2017-05-31 00:08:48martin.pantersetrecipients: + martin.panter, René Hernández Remedios
2017-05-31 00:08:47martin.pantersetmessageid: <1496189327.39.0.997090910355.issue30516@psf.upfronthosting.co.za>
2017-05-31 00:08:47martin.panterlinkissue30516 messages
2017-05-31 00:08:46martin.pantercreate