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 <200811120132.19260.victor.stinner@haypocalc.com>
In-reply-to <1226444417.18.0.329650799396.issue3439@psf.upfronthosting.co.za>
Content
[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

done

> (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"

done

--

10
>>> x=1023L; x.numbits
10L
>>> x=2**(2**10); n=x.numbits; n, n.numbits
(1025L, 11L)
Files
File name Uploaded
numbits-4.patch vstinner, 2008-11-12.00:33:09
History
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