Message128237
| Author |
mark.dickinson |
| Recipients |
arigo, loewis, mark.dickinson |
| Date |
2011年02月09日.20:40:07 |
| SpamBayes Score |
5.6508034e-09 |
| Marked as misclassified |
No |
| Message-id |
<1297284009.08.0.894852336514.issue11144@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
This turns out to be a one-line fix (modulo comments and tests); see attached patch. The new code depends on the assumption that C longs are represented using two's complement, but note that this assumption is (a) already present elsewhere in the Python core (e.g., in the definition of bitwise operations for ints), and (b) universally true in practice (as far as I'm aware). For theoretical completeness, it would be easy to write a different test for ones' complement and sign-magnitude machines, but in practice that seems pointless, and given the near-impossibility of testing that code, I left it out. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年02月09日 20:40:09 | mark.dickinson | set | recipients:
+ mark.dickinson, loewis, arigo |
| 2011年02月09日 20:40:09 | mark.dickinson | set | messageid: <1297284009.08.0.894852336514.issue11144@psf.upfronthosting.co.za> |
| 2011年02月09日 20:40:08 | mark.dickinson | link | issue11144 messages |
| 2011年02月09日 20:40:08 | mark.dickinson | create |
|