Is there a Python class or module that implements a structure that is similar to the BitSet?
相关问题
- Delete Messages from a Topic in Apache Kafka
- how to define constructor for Python's new Nam
- Jackson Deserialization not calling deserialize on
- streaming md5sum of contents of a large remote tar
- How to maintain order of key-value in DataFrame sa
You might like to take a look at a module I wrote called bitstring (full documentation here), although for simple cases that need to be as fast as possible I'd still recommend bitarray.
Some similar questions:
What is the best way to do Bit Field manipulation in Python?
Does Python have a bitfield type?
Python Bitstream implementations
Have a look at this implementation in Python 3.
The implementation basically makes use of the built-in
int
type, which is arbitrary precision integer type in Python 3 (wherelong
is the Python 2 equivalent).There's nothing in the standard library. Try:
http://pypi.python.org/pypi/bitarray