How to determine what called __cmp__ method?

Fredrik Lundh effbot at telia.com
Sat Oct 21 06:16:06 EDT 2000


Erik Max Francis wrote:
> Pearu Peterson wrote:
>
> > The question is how to determine inside __cmp__ method where it was
> > called? That is I want to know was it called for evaluating
> > either inequality '<', or '>', or '<=', or ...?
>
> Why would you need to do that?  The purpose of the __cmp__ method is to
> avoid such issues.  I submit that if you _really_ need to know which
> operation was being requested, there's something wrong with either your
> algorithm, your design, or both.

bzzt.  try again.

</F>





More information about the Python-list mailing list