Customisation of comparison operators
Dave Haynes
Dave.Haynes at sia-mce.co.uk
Fri Mar 22 16:07:43 EST 2002
More information about the Python-list mailing list
Fri Mar 22 16:07:43 EST 2002
- Previous message (by thread): Customisation of comparison operators
- Next message (by thread): Customisation of comparison operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
Which of __lt__, __le__, __eq__, __ne__, __gt__, __ge__ are used when
sorting lists of objects with <list>.sort()? Which of them is used for
the 'in' and 'not in' comparisons?
Is __cmp__ no longer used at all if the above are defined?
This might be dodgy practice, but I have some objects for which I
want to provide subtly different behaviour for the comparison
operators than for testing 'in' and 'not in'...
Cheers,
Dave.
- Previous message (by thread): Customisation of comparison operators
- Next message (by thread): Customisation of comparison operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list