[issue29882] Add an efficient popcount method for integers

Mark Dickinson report at bugs.python.org
Sat Jun 1 16:34:42 EDT 2019


Mark Dickinson <dickinsm at gmail.com> added the comment:

> Is everyone comfortable with how negative numbers are handled by this patch?

Not entirely, but it's not terribly wrong and it's consistent with how `int.bit_length` works. (I'm also a bit uncomfortable about `int.bit_length`s behaviour on negative numbers, but it is the way it is.)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue29882>
_______________________________________


More information about the Python-bugs-list mailing list