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 ncoghlan
Recipients belopolsky, brian.curtin, loewis, max-alleged, ncoghlan, ocean-city, terry.reedy
Date 2012-07-26.01:54:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343267696.53.0.300456907611.issue10654@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2012-07-26 01:54:56ncoghlansetrecipients: + ncoghlan, loewis, terry.reedy, belopolsky, ocean-city, brian.curtin, max-alleged
2012-07-26 01:54:56ncoghlansetmessageid: <1343267696.53.0.300456907611.issue10654@psf.upfronthosting.co.za>
2012-07-26 01:54:55ncoghlanlinkissue10654 messages
2012-07-26 01:54:55ncoghlancreate