Message166451
The precedence problems described in #11477 shouldn't factor into this case - that issue is specific to C level types that implement + and * via tp_as_sequence *without* implementing the corresponding slots in tp_as_number. That's not the case here, since datetime types *only* implement the slots via tp_as_number.
I can't reproduce the failure at all, so here's a couple of tricks for Windows users trying to reproduce or investigate the problem:
# Getting the C version of datetime:
import _datetime as cdt
# Getting the pure Python version of datetime:
from test.support import import_fresh_module
pydt = import_fresh_module("datetime", blocked=["_datetime"])
# Test the results of all the following operations
d+1
1+d
d.__add__(1)
d.__radd__(1)
1 .__add__(d)
1 .__radd__(d)
# For the following kinds of "d"
d = cdt.datetime(1, 2, 3)
d = pydt.datetime(1, 2, 3)
class SubC(cdt.datetime): pass
d = SubC(1, 2, 3)
class SubPy(cdt.datetime): pass
d = SubPy(1, 2, 3) |
|
Date |
User |
Action |
Args |
2012-07-26 01:54:56 | ncoghlan | set | recipients:
+ ncoghlan, loewis, terry.reedy, belopolsky, ocean-city, brian.curtin, max-alleged |
2012-07-26 01:54:56 | ncoghlan | set | messageid: <1343267696.53.0.300456907611.issue10654@psf.upfronthosting.co.za> |
2012-07-26 01:54:55 | ncoghlan | link | issue10654 messages |
2012-07-26 01:54:55 | ncoghlan | create | |
|