This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, stutzbach
Date 2010-05-08.10:07:42
SpamBayes Score 0.0019695063
Marked as misclassified No
Message-id <1273313264.4.0.5447223523.issue8659@psf.upfronthosting.co.za>
In-reply-to
Content
Ah, now I understand :)

r2604 introduced a scheme where for a negative PyLongObject x with n digits, the value stored in x->ob_size was -1-n.  A little like ones' complement, but unrelated to anything to do with the platform integer representation.  So at that stage there were two possible internal representations of 0L, which is why all the ZABS() stuff was necessary to make sure that those two representations of 0L compared equal.

r2751 (in 1992, indeed!) reversed this, using -n instead of -1-n for this case, but didn't remove the extra tests for the two different representations of 0L.  r2751 also changed the semantics of long bitwise operations for negative numbers, but that's not relevant to this issue.

Sorry for being slow.

It's impressive that this piece of redundant code has survived this long.
History
Date User Action Args
2010-05-08 10:07:44mark.dickinsonsetrecipients: + mark.dickinson, stutzbach
2010-05-08 10:07:44mark.dickinsonsetmessageid: <1273313264.4.0.5447223523.issue8659@psf.upfronthosting.co.za>
2010-05-08 10:07:43mark.dickinsonlinkissue8659 messages
2010-05-08 10:07:42mark.dickinsoncreate