Ask Your Question

comparing in Python

asked 2012-10-28 11:01:51 -0600

SLOtoSF gravatar image

updated 2012-10-28 11:02:02 -0600

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()) ==


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

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-10-29 03:32:51 -0600

Jason Grout gravatar image
edit flag offensive delete link more


Thank you.

SLOtoSF gravatar imageSLOtoSF ( 2012-10-29 06:36:00 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-10-28 11:01:51 -0600

Seen: 105 times

Last updated: Oct 29 '12