13 Mar
2007
13 Mar
'07
1:17 a.m.
On 3/12/07, Steven Bethard
On 3/12/07, Christian Heimes
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.
But it can still be <=, by being <. I would personally be OK with just saying that (year, month, day) sorts less than (year, month, day, ...) regardless of time, simply because of the type -- but I admit that would be arbitrary. ...
Fair enough. My only point was that as long as __lt__ is defined, __le__ can throw a TypeError() and it won't break sorted().
Mea culpa. I was mis-remembering, and thought that even this would break because of sort stability. -jJ