Do not expand boolean PYSON when using __and__ and __or__
It is not expected that the left operand is modified by such operations. issue11836 review418551003 (grafted from 4da4f8a946ad698feac01663778495d92c992588) --HG-- branch : 6.0
This commit is contained in:
+2
-4
@@ -31,8 +31,7 @@ class PYSON(object):
|
||||
other = Bool(other)
|
||||
if (isinstance(self, And)
|
||||
and not isinstance(self, Or)):
|
||||
self._statements.append(other)
|
||||
return self
|
||||
return And(*self._statements, other)
|
||||
if self.types() != {bool}:
|
||||
return And(Bool(self), other)
|
||||
else:
|
||||
@@ -45,8 +44,7 @@ class PYSON(object):
|
||||
and other.types() != {bool}):
|
||||
other = Bool(other)
|
||||
if isinstance(self, Or):
|
||||
self._statements.append(other)
|
||||
return self
|
||||
return Or(*self._statements, other)
|
||||
if self.types() != {bool}:
|
||||
return Or(Bool(self), other)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user