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 loewis
Recipients belopolsky, benjamin.peterson, casevh, georg.brandl, jimjjewett, ked-tao, lemburg, loewis, mark.dickinson, pitrou, rhettinger, skip.montanaro, tim.peters
Date 2010-10-18.20:44:25
SpamBayes Score 3.654785e-07
Marked as misclassified No
Message-id <>
In-reply-to <1287415644.3492.5.camel@localhost.localdomain>
Am 18.10.2010 17:27, schrieb Antoine Pitrou:
> Antoine Pitrou <> added the comment:
>> AFAICT, a change from (Py_ssize_t)-1 to (size_t)-1 is less likely to
>> break code than a change from -1L to  (Py_ssize_t)-1.  (Assuming a
>> sizeof(long) != sizeof(void*) platform.)
> That's true.

I don't think it is. Code that is changed to use the new return type
will not break in a change from long to Py_ssize_t, since all values
will sign-expand correctly, in all cases; the same is true if the new
return type was size_t. So for code that gets adjusted in its return
value, no breakage in either case.

For code that *doesn't* get adjusted, I'm still uncertain what will
happen. However, ISTM that if there is a cast to the "correct" function
pointer type, you get an incorrect detection of the guard value in
either case: e.g. on AMD64, the return value is in RAX, yet the hash
function may only fill out EAX. I'm not sure what values the upper
32 bits will have, but I doubt it gets sign-expanded - which it should
regardless of whether the expected value is (size_t)-1 or
(Py_ssize_t)-1. So you get breakage in either case.

Please correct me if I'm wrong.
Date User Action Args
2010-10-18 20:44:27loewissetrecipients: + loewis, lemburg, tim.peters, skip.montanaro, georg.brandl, rhettinger, jimjjewett, mark.dickinson, belopolsky, pitrou, casevh, ked-tao, benjamin.peterson
2010-10-18 20:44:25loewislinkissue9778 messages
2010-10-18 20:44:25loewiscreate