Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

asked 12 years ago

SLOtoSF gravatar image

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?

click to hide/show revision 2
No.2 Revision

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?