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.

作者 belopolsky
收信人 belopolsky, benjamin.peterson, casevh, georg.brandl, jimjjewett, ked-tao, lemburg, loewis, mark.dickinson, pitrou, rhettinger, skip.montanaro, tim.peters
日期 2010-10-18.14:09:10
SpamBayes Score 5.965413e-05
Marked as misclassified
Message-id <AANLkTim1BmVeY9fFCVmMFnaq1Okc4eyCjt5n86Rf9UoC@mail.gmail.com>
In-reply-to <1287410381.3492.2.camel@localhost.localdomain>
内容
On Mon, Oct 18, 2010 at 9:59 AM, Antoine Pitrou <report@bugs.python.org> wrote:
..
>> Why?  As far as I can tell, negative values are only used as sentinels
>> and we can use say (size_t)-1 instead of -1L.
>
> You can, except that changing the sentinel value will probably break a
> lot of code out there (and there's no benefit AFAICT).

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.)  The benefit, though is that
hash computations can be performed natively on the hash values without
casting to an unrelated type.  If Py_hash_t needs to be signed, I
would like to see a typedef Py_uhash_t size_t next to that for
Py_hash_t and  Py_uhash_t used in hash computations rather than
explicit size_t.
历史
日期 用户 动作 参数
2010-10-18 14:09:12belopolsky修改recipients: + belopolsky, lemburg, tim.peters, loewis, skip.montanaro, georg.brandl, rhettinger, jimjjewett, mark.dickinson, pitrou, casevh, ked-tao, benjamin.peterson
2010-10-18 14:09:11belopolsky链接issue9778 messages
2010-10-18 14:09:10belopolsky创建