[issue23591] enum: Add Flags and IntFlags

STINNER Victor report at bugs.python.org
Thu Sep 1 05:04:03 EDT 2016


STINNER Victor added the comment:

As noticed by veky on the review, _high_bit() is slow and can be optimized using int.bit_length(). Attached bit_length.patch implements this.

_high_bit(0) returns -1. Maybe an exception must be raised if the argument is < 1? (also fail for negative number)

----------
Added file: http://bugs.python.org/file44319/bit_length.patch

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


More information about the Python-bugs-list mailing list