Message7335
| Author |
Arfrever |
| Recipients |
Arfrever, fwierzbicki |
| Date |
2012年07月25日.00:57:35 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1343177856.59.0.148957840677.issue1950@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
datetime.date.__add__() should return NotImplemented instead of raising TypeError, as is already mentioned in source code.
This change fixes errors in test suite of python-dateutil (http://pypi.python.org/pypi/python-dateutil).
--- Lib/datetime.py
+++ Lib/datetime.py
@@ -911,8 +911,7 @@
self._checkOverflow(t.year)
result = date(t.year, t.month, t.day)
return result
- raise TypeError
- # XXX Should be 'return NotImplemented', but there's a bug in 2.2...
+ return NotImplemented
__radd__ = __add__ |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年07月25日 00:57:36 | Arfrever | set | recipients:
+ Arfrever, fwierzbicki |
| 2012年07月25日 00:57:36 | Arfrever | set | messageid: <1343177856.59.0.148957840677.issue1950@psf.upfronthosting.co.za> |
| 2012年07月25日 00:57:36 | Arfrever | link | issue1950 messages |
| 2012年07月25日 00:57:35 | Arfrever | create |
|