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 rhettinger
Recipients rhettinger, serhiy.storchaka
Date 2015-03-01.06:09:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1425190155.04.0.477629111053.issue23553@psf.upfronthosting.co.za>
In-reply-to
Content
> The type of i and Py_SIZE(a) is Py_ssize_t, so when casted to 
> unsigned int, highest bits are lost. The correct casting type is size_t.

Yes, I had just seen that a early today and deciding whether to substitute size_t for the unsigned cast or whether to just revert.   I believe size_t is guaranteed to hold any array index and that a cast from non-negative Py_ssize_t would not lose bits.

> But in CPython implementation sizes are signed (Py_ssize_t). 
> The problem with using this optimization (rather low-level 
> than high-level) is that we need to know unsigned version of
> the type of compared values.

Wouldn't size_t always work for Py_ssize_t?
History
Date User Action Args
2015-03-01 06:09:15rhettingersetrecipients: + rhettinger, serhiy.storchaka
2015-03-01 06:09:15rhettingersetmessageid: <1425190155.04.0.477629111053.issue23553@psf.upfronthosting.co.za>
2015-03-01 06:09:15rhettingerlinkissue23553 messages
2015-03-01 06:09:14rhettingercreate