Message236933
> 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? |
|
Date |
User |
Action |
Args |
2015-03-01 06:09:15 | rhettinger | set | recipients:
+ rhettinger, serhiy.storchaka |
2015-03-01 06:09:15 | rhettinger | set | messageid: <1425190155.04.0.477629111053.issue23553@psf.upfronthosting.co.za> |
2015-03-01 06:09:15 | rhettinger | link | issue23553 messages |
2015-03-01 06:09:14 | rhettinger | create | |
|