Fix subtle bugs in &|^ overloading.

This commit is contained in:
Guido van Rossum 2002-03-09 14:53:04 +00:00
parent cbd58349eb
commit ec6a886793
1 changed files with 3 additions and 3 deletions

View File

@ -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__