Author: Philip Jenvey <[email protected]>
Branch: remove-intlong-smm
Changeset: r69142:d1533165b692
Date: 2014-02-14 15:41 -0800
http://bitbucket.org/pypy/pypy/changeset/d1533165b692/
Log: fix
diff --git a/pypy/objspace/std/boolobject.py b/pypy/objspace/std/boolobject.py
--- a/pypy/objspace/std/boolobject.py
+++ b/pypy/objspace/std/boolobject.py
@@ -6,7 +6,8 @@
from rpython.tool.sourcetools import func_renamer, func_with_new_name
from pypy.interpreter.gateway import WrappedDefault, interp2app, unwrap_spec
-from pypy.objspace.std.intobject import IntMethods, W_AbstractIntObject
+from pypy.objspace.std.intobject import (
+ IntMethods, W_AbstractIntObject, W_IntObject)
from pypy.objspace.std.stdtypedef import StdTypeDef
@@ -53,13 +54,13 @@
def make_bitwise_binop(opname):
descr_name = 'descr_' + opname
- super_op = getattr(W_AbstractIntObject, descr_name)
+ int_op = getattr(W_IntObject, descr_name)
op = getattr(operator,
opname + '_' if opname in ('and', 'or') else opname)
@func_renamer(descr_name)
def descr_binop(self, space, w_other):
if not isinstance(w_other, W_BoolObject):
- return super_op(self, space, w_other)
+ return int_op(self.int(space), space, w_other)
return space.newbool(op(self.boolval, w_other.boolval))
return descr_binop, func_with_new_name(descr_binop, 'descr_r' + opname)
diff --git a/pypy/objspace/std/test/test_boolobject.py
b/pypy/objspace/std/test/test_boolobject.py
--- a/pypy/objspace/std/test/test_boolobject.py
+++ b/pypy/objspace/std/test/test_boolobject.py
@@ -60,6 +60,8 @@
assert True ^ True is False
assert False ^ False is False
assert True ^ False is True
+ assert True & 1 == 1
+ assert False & 0 == 0 & 0
def test_new(self):
assert bool.__new__(bool, "hi") is True
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit