Message369777
> I confess that I've no idea what the "without overflow check" bit means
After some digging, it is indeed to do with the int/long unification:
- In Python 2.1, arithmetic operations on ints would raise OverflowError on overflow.
- Except that left shift did not raise: shifted out bits were simply lost. This is described in PEP 237.
In Python 2.2, arithmetic operations (including left shift) were changed to produce a long instead of overflowing.
The "without overflow check" part of the doc almost certainly refers to the Python 2.1 behaviour (at least for left shift; I'm guessing that for right shift, where overflow isn't possible, this was just a redundant copy-paste), and was never updated. It should be removed for both left shift and right shift. |
|
Date |
User |
Action |
Args |
2020-05-24 10:17:45 | mark.dickinson | set | recipients:
+ mark.dickinson, ncoghlan, docs@python, ZackerySpytz |
2020-05-24 10:17:45 | mark.dickinson | set | messageid: <1590315465.14.0.766487349262.issue39301@roundup.psfhosted.org> |
2020-05-24 10:17:45 | mark.dickinson | link | issue39301 messages |
2020-05-24 10:17:44 | mark.dickinson | create | |
|