[issue3439] create a numbits() method for int and long types

Skip Montanaro report at bugs.python.org
Tue Dec 16 19:33:20 CET 2008


Skip Montanaro <skip at pobox.com> added the comment:

Regarding the last few posts:

 * Raymond's implementation, while ugly, provides a completely orthogonal
   way to test compute numbits, useful in unit tests if nothing else.

 * Using x >> 1 in a reference implementation is perfectly reasonable.
   If the person using the reference implementation to produce a real
   C-based implementation doesn't understand the equivalence of x // 2
   and x >> 1, heaven help us.

Skip

----------
nosy: +skip.montanaro

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3439>
_______________________________________


More information about the Python-bugs-list mailing list