
March 12, 2007
6:06 p.m.
On 3/12/07, Christian Heimes <lists@cheimes.de> wrote:
Steven Bethard schrieb:
datetime <= date and datetime => date should raise a TypeError. The result is ambiguous. A date with time is never equal to a date.
Jim Jewett wrote:
As a practical matter, sorting uses <=
Are you sure?
It depends what tp slot is defined. The C api supports either comparison (cmp style -1, 0, 1) or rich comparison (func(self, other, operator)).
Fair enough. My only point was that as long as __lt__ is defined, __le__ can throw a TypeError() and it won't break sorted(). STeVe -- I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a tiny blip on the distant coast of sanity. --- Bucky Katt, Get Fuzzy