◐ Shell
clean mode source ↗

Message 75771 - Python tracker

[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)