mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
better cmp operator for Tasks
This commit is contained in:
parent
3cbb4819a4
commit
b1377f317e
@ -87,12 +87,10 @@ class Task:
|
|||||||
# If the wakeTimes happen to be the same, just
|
# If the wakeTimes happen to be the same, just
|
||||||
# sort them based on id
|
# sort them based on id
|
||||||
else:
|
else:
|
||||||
return cmp(self.id, other.id)
|
return cmp(id(self), id(other))
|
||||||
# Not sure what to do here, I guess we should just make sure it is
|
# This is important for people doing a (task != None) and such.
|
||||||
# not equal since it cannot be. Should it be less than or greater
|
|
||||||
# than? Not sure anybody will care.
|
|
||||||
else:
|
else:
|
||||||
return -1
|
return cmp(id(self), id(other))
|
||||||
|
|
||||||
# According to the Python manual (3.3.1), if you define a cmp operator
|
# According to the Python manual (3.3.1), if you define a cmp operator
|
||||||
# you should also define a hash operator or your objects will not be
|
# you should also define a hash operator or your objects will not be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user