On 22 Jun., 11:25, Franco Saliola wrote:
> Hello,
>
> Here is a quick description of what is below: Subclasses of Element
> complain that no sorting algorithm is defined even when all the rich
> comparison methods have been implemented. Bug?
>
> In the code sample below, C is a class that inher
On Jun 22, 2009, at 2:25 AM, Franco Saliola wrote:
>
> Hello,
>
> Here is a quick description of what is below: Subclasses of Element
> complain that no sorting algorithm is defined even when all the rich
> comparison methods have been implemented. Bug?
>
> In the code sample below, C is a class
On Tue, Jun 23, 2009 at 12:25 AM, Ondrej Certik wrote:
>
> On Mon, Jun 22, 2009 at 3:25 AM, Franco Saliola wrote:
>>
>> Hello,
>>
>> Here is a quick description of what is below: Subclasses of Element
>> complain that no sorting algorithm is defined even when all the rich
>> comparison methods hav
On Mon, Jun 22, 2009 at 3:25 AM, Franco Saliola wrote:
>
> Hello,
>
> Here is a quick description of what is below: Subclasses of Element
> complain that no sorting algorithm is defined even when all the rich
> comparison methods have been implemented. Bug?
If it helps, I create this page, that l
On Mon, Jun 22, 2009 at 11:25:32AM +0200, Franco Saliola wrote:
> Here is a quick description of what is below: Subclasses of Element
> complain that no sorting algorithm is defined even when all the rich
> comparison methods have been implemented. Bug?
>
> In the code sample below, C is a class
If your class has a total order, just override __cmp__. To define
partial orders, one needs to override _eq_, etc. separately for
python classes, and richcmp for Cython classes.
- Robert
On Oct 26, 2007, at 3:04 PM, didier deshommes wrote:
> 2007/10/26, Robert Miller <[EMAIL PROTECTED]>:
>
2007/10/26, Robert Miller <[EMAIL PROTECTED]>:
> I have some questions about Python comparison. Suppose I have a Python
> class representing objects under some ordering, and I want to
> implement <=, <, >=, >, ==, != comparisons on those objects. I
> remember hearing somewhere that the __cmp__ met