Dnia Sun, 10 Aug 2008 20:26:51 +0200, WP napisa³(a):
Hi,
....
Check this out: http://docs.python.org/ref/customization.html
Definition of this method should rather look like this:
=============== =============== ============
def __cmp__(self, other):
print "in __cmp__"
if self.score == other.score:
return 0
elif self.score other.score:
return 1
return -1
=============== =============== ============
Should work fine now.
--
Regards,
Wojtek Walczak,
Hi,
Hello, here are some new things I've problems with. I've made a program
def __cmp__(self, other):
print "in __cmp__"
return self.score >= other.score
print "in __cmp__"
return self.score >= other.score
Definition of this method should rather look like this:
=============== =============== ============
def __cmp__(self, other):
print "in __cmp__"
if self.score == other.score:
return 0
elif self.score other.score:
return 1
return -1
=============== =============== ============
Should work fine now.
--
Regards,
Wojtek Walczak,