
March 13, 2007
1:17 a.m.
On 3/12/07, Steven Bethard <steven.bethard@gmail.com> wrote:
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.
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