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.

作者 vstinner
收信人 fredrikj, loewis, mark.dickinson, rhettinger, terry.reedy, vstinner
日期 2008-12-12.18:03:14
SpamBayes Score 6.8924004e-07
Marked as misclassified
Message-id <200812121902.43354.victor.stinner@haypocalc.com>
In-reply-to <1229102766.46.0.764896873316.issue3439@psf.upfronthosting.co.za>
内容
> - why do you use PyLong_FromSize_t rather than PyInt_FromSize_t?

I choosed to use consistent result type. But now I would prefer int :-) I see 
that PyInt_FromSize_t() returns a long if the value doesn't fit in an int. So 
it's correct.

> - isn't the if (ndigits == 0) check redundant?

I'm paranoid: if _PyLong_NumBits() fails but the number is zero, the function 
may crash. But this case is impossible: _PyLong_NumBits() can only fails with 
an OverflowError.

Can you fix these two issues (use PyInt_FromSize_t and remove the if)?
历史
日期 用户 动作 参数
2008-12-12 18:03:15vstinner修改recipients: + vstinner, loewis, rhettinger, terry.reedy, mark.dickinson, fredrikj
2008-12-12 18:03:14vstinner链接issue3439 messages
2008-12-12 18:03:14vstinner创建