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 jess.austin
Recipients jess.austin
Date 2009-03-19.00:51:22
SpamBayes Score 0.00058847334
Marked as misclassified No
Message-id <1237423886.27.0.985547007127.issue5516@psf.upfronthosting.co.za>
In-reply-to
Content
While the datetime.date and datetime.datetime classes consistently
handle mixed-type comparison, their subclasses do not:

>>> from datetime import date, datetime, time
>>> d = date.today()
>>> dt = datetime.combine(d, time())
>>> d == dt
False
>>> dt == d
False
>>> class D(date):
...     pass
... 
>>> class DT(datetime):
...     pass
... 
>>> d = D.today()
>>> dt = DT.combine(d, time())
>>> d == dt
True
>>> dt == d
False

I think this is due to the premature "optimization" of using memcmp() in
date_richcompare().
History
Date User Action Args
2009-03-19 00:51:27jess.austinsetrecipients: + jess.austin
2009-03-19 00:51:26jess.austinsetmessageid: <1237423886.27.0.985547007127.issue5516@psf.upfronthosting.co.za>
2009-03-19 00:51:23jess.austinlinkissue5516 messages
2009-03-19 00:51:22jess.austincreate