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 vstinner
Recipients fredrikj, loewis, mark.dickinson, rhettinger, terry.reedy, vstinner
Date 2008-11-12.00:33:10
SpamBayes Score 1.9641354e-07
Marked as misclassified No
Message-id <>
In-reply-to <>
[Mark Dickinson]
> (1) the number of bits should be computed first directly using ...

_PyLong_NumBits() : done. But the result type is always long.

> (2) Just as a matter of style, I think "if (x == NULL)" is preferable


> (4) I quite like the idea of having numbits be a property rather than a
> method---might still be worth considering?

I agree, so in the new patch, numbits is now a property.

[Fredrik Johansson]
> In stdtypes.rst, x.numbits should be listed in the table under
> "Bit-string Operations on Integer Types"



>>> x=1023L; x.numbits
>>> x=2**(2**10); n=x.numbits; n, n.numbits
(1025L, 11L)
File name Uploaded
numbits-4.patch vstinner, 2008-11-12.00:33:09
Date User Action Args
2008-11-12 00:33:12vstinnersetrecipients: + vstinner, loewis, rhettinger, terry.reedy, mark.dickinson, fredrikj
2008-11-12 00:33:11vstinnerlinkissue3439 messages
2008-11-12 00:33:10vstinnercreate