Fix subtle bugs in &|^ overloading.
This commit is contained in:
parent
cbd58349eb
commit
ec6a886793
|
@ -103,7 +103,7 @@ Specification
|
|||
if isinstance(other, bool):
|
||||
return bool(int(self) & int(other))
|
||||
else:
|
||||
return NotImplemented
|
||||
return int.__and__(self, other)
|
||||
|
||||
__rand__ = __and__
|
||||
|
||||
|
@ -111,7 +111,7 @@ Specification
|
|||
if isinstance(other, bool):
|
||||
return bool(int(self) | int(other))
|
||||
else:
|
||||
return NotImplemented
|
||||
return int.__or__(self, other)
|
||||
|
||||
__ror__ = __or__
|
||||
|
||||
|
@ -119,7 +119,7 @@ Specification
|
|||
if isinstance(other, bool):
|
||||
return bool(int(self) ^ int(other))
|
||||
else:
|
||||
return NotImplemented
|
||||
return int.__xor__(self, other)
|
||||
|
||||
__rxor__ = __xor__
|
||||
|
||||
|
|
Loading…
Reference in New Issue