Ask Your Question
0

comparing in Python

asked 12 years ago

SLOtoSF gravatar image

updated 12 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 12 years ago

Jason Grout gravatar image
Preview: (hide)
link

Comments

Thank you.

SLOtoSF gravatar imageSLOtoSF ( 12 years ago )

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: 12 years ago

Seen: 263 times

Last updated: Oct 29 '12