Whole file

construct/construct

The author described this change as FIX: Left-shift operator (#406). It counts as a record because the check below fails on the code as it stood at a8c4e8be1 and passes on 02ec101c1, with nothing else changed between the two runs.

Fix saved2017-10-08
Sharing licenceMIT · LICENSE
Change size+2 2

What the code was meant to do, written into the code itself as a save note

FIX: Left-shift operator (#406)

The change

5151 def __rshift__(self, other):
5252 return BinExpr(operator.rshift, self, other)
5353 def __lshift__(self, other):
54- return BinExpr(operator.rshift, self, other)
54+ return BinExpr(operator.lshift, self, other)
5555 def __and__(self, other):
5656 return BinExpr(operator.and_, self, other)
5757 def __or__(self, other):
7777 def __rrshift__(self, other):
7878 return BinExpr(operator.rshift, other, self)
7979 def __rlshift__(self, other):
80- return BinExpr(operator.rshift, other, self)
80+ return BinExpr(operator.lshift, other, self)
8181 def __rand__(self, other):
8282 return BinExpr(operator.and_, other, self)
8383 def __ror__(self, other):

The check that tells the two apart

failpass·tests/test_all.py::TestCore::test_lshift

Check file tests/test_all.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before ita8c4e8be1bb7950423bbfc53c9eaf300081a9526
Broken version dated2017-10-08
Moduleconstruct.expr
Units changedExprMixin
Fingerprint8e304bbe2cabb0b1
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in construct/construct