lib.wiring: fix equality of FlippedSignature with other object.
Fixes #882.
This commit is contained in:
parent
cfd4f9c84e
commit
44d5fac01c
2 changed files with 17 additions and 3 deletions
|
|
@ -484,9 +484,11 @@ class FlippedSignature:
|
|||
return self.flip() == other.flip()
|
||||
else:
|
||||
# Delegate comparisons back to Signature (or its descendant) by flipping the arguments;
|
||||
# equality must be reflexive but the implementation of __eq__ need not be, and we can
|
||||
# take advantage of it here.
|
||||
return other == self
|
||||
# equality must be reflexive but the implementation of `__eq__` need not be, and we can
|
||||
# take advantage of it here. This is done by returning `NotImplemented`, otherwise if
|
||||
# the other object cannot be compared to a `FlippedSignature` either this will result
|
||||
# in infinite recursion.
|
||||
return NotImplemented
|
||||
|
||||
# These methods do not access instance variables and so their implementation can be shared
|
||||
# between the normal and the flipped member collections.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue