strange behavior of the comparison operator

Nicolas Evrard nicoe at wanadoo.be
Thu Aug 30 13:27:20 EDT 2001


On 20:10 29.08.2001 Jeff Shannon wrote:
> 
> Nicolas Evrard wrote:
> 
> > Hello everyone, this is my first post to the list and let me say that I
> > find python really exciting ... Looks a bit like scheme but is fast and
> > have a large community of users ...
> >
> > Here 's what I've done :
> >
> > To try the __comp__ method I've done a class for complex number (the
> usual
> > example). But here are the result I've got :
> >
> 
> ... I think that the real problem here, is that you actually want to be
> defining __cmp__ (no 'o').  Your __comp__ method works just fine, but is
> not
> called when using less-than (<) (or any other comparison operator, of
> course).

Thanks that did the trick ... What a fool I am I didn't even tough about a
typo ;)

-- 
--------------------------------------- -°)
Evrard Nicolas        Happily using:    /\\
Liège (Belgium)      DEBIAN GNU\LINUX  _\//
--------------------------------------------




More information about the Python-list mailing list