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.
Projectconstruct/construct
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
| 51 | 51 | def __rshift__(self, other): | |
| 52 | 52 | return BinExpr(operator.rshift, self, other) | |
| 53 | 53 | def __lshift__(self, other): | |
| 54 | - | return BinExpr(operator.rshift, self, other) | |
| 54 | + | return BinExpr(operator.lshift, self, other) | |
| 55 | 55 | def __and__(self, other): | |
| 56 | 56 | return BinExpr(operator.and_, self, other) | |
| 57 | 57 | def __or__(self, other): | |
| ⋯ | |||
| 77 | 77 | def __rrshift__(self, other): | |
| 78 | 78 | return BinExpr(operator.rshift, other, self) | |
| 79 | 79 | def __rlshift__(self, other): | |
| 80 | - | return BinExpr(operator.rshift, other, self) | |
| 80 | + | return BinExpr(operator.lshift, other, self) | |
| 81 | 81 | def __rand__(self, other): | |
| 82 | 82 | return BinExpr(operator.and_, other, self) | |
| 83 | 83 | def __ror__(self, other): | |
The check that tells the two apart
fail→pass·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
- 2022-09-18Lazy
- 2018-05-05Fix issue #709: Hex() might not always work.
- 2018-04-02VarInt
- 2018-03-03TransformData
- 2017-08-29Switch
- 2017-06-01RawCopy