[issue19915] int.bit_at(n) - Accessing a single bit in O(1)

Antoine Pitrou report at bugs.python.org
Wed Oct 1 22:59:59 CEST 2014


Antoine Pitrou added the comment:

@anon: if there is a patch, any committer here can get it into 3.5. You'll recognize them as they have a nice Python logo next to their usernames ;-) If you want to try your hand at a patch, see https://docs.python.org/devguide/

By the way, I think it would be extra cool to implement this as a ".bits" pseudo-sequence, e.g.

>>> x = 255
>>> x.bits[0]
1
>>> x.bits[1:3]
7

However, it might not be so easy to do it in C...

----------
status: pending -> open

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


More information about the Python-bugs-list mailing list