Directly Overloading ==

Courageous jkraska1 at san.rr.com
Wed Sep 13 01:22:23 EDT 2000


> c = (a == b)

I see how you'd find this appealing, but this kind
of legerdemain is exactly why more modern language
designers have gotten turned off by operator overload.

Anyway, I looked into your question, and I believe
the answer is "no". __cmp__ is called when the
expression (a==b) is evaluated. If __cmp__() 
returns 0, they are considered equal. Less than
one and greater than one are for < and > comparisons.



C//



More information about the Python-list mailing list