Ask Your Question
0

comparing in Python

asked 2012-10-28 17:01:51 +0100

SLOtoSF gravatar image

updated 2012-10-28 17:02:02 +0100

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-10-29 09:32:51 +0100

Jason Grout gravatar image
edit flag offensive delete link more

Comments

Thank you.

SLOtoSF gravatar imageSLOtoSF ( 2012-10-29 12:36:00 +0100 )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

Stats

Asked: 2012-10-28 17:01:51 +0100

Seen: 256 times

Last updated: Oct 29 '12