Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

comparing Expression in Python

I have the following function defined on a class:

def __eq__(self,other):
        return self.get_object() == other.get_object() and str(self.get_genfunc()) ==

str(other.get_genfunc())

When I use __cmp__ I get something weird.... What is the difference between cmp and eq?

comparing Expression in Python

I have the following function defined on a class:

def __eq__(self,other):
        return self.get_object() == other.get_object() and str(self.get_genfunc()) ==

str(other.get_genfunc())

When I use __cmp__ I get something weird.... What is the difference between cmp and eq?