https://github.com/synodriver/pybitset
python binding for bitset
https://github.com/synodriver/pybitset
Last synced: about 1 year ago
JSON representation
python binding for bitset
- Host: GitHub
- URL: https://github.com/synodriver/pybitset
- Owner: synodriver
- Created: 2023-06-15T16:22:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-27T12:02:21.000Z (about 2 years ago)
- Last Synced: 2024-10-11T11:26:08.755Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 268 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- Changelog: changename.py
Awesome Lists containing this project
README
✨ pybitset ✨
The python binding for cbitset
[](https://pypi.org/project/pybitset/)





### install
```bash
pip install pybitset
```
### Usage
```python
from pybitset import BitSet
b= BitSet()
for i in range(1000):
b.set(3*i)
for v in b:
print(v)
```
- use ```BITSET_USE_CFFI``` env var to specify a backend
### Public functions
```python
class BitSet:
def __init__(self) -> None: ...
def __del__(self) -> None: ...
@staticmethod
def from_ptr(ptr) -> BitSet: ...
def clear(self) -> None: ...
def fill(self) -> None: ...
def copy(self) -> BitSet: ...
def resize(self, newarraysize: int, padwithzeroes: bool) -> bool: ...
def size_in_bytes(self) -> int: ...
def size_in_bits(self) -> int: ...
def size_in_words(self) -> int: ...
def grow(self, newarraysize: int) -> bool: ...
def trim(self) -> bool: ...
def shift_left(self, s: int) -> None: ...
def shift_right(self, s: int) -> None: ...
def set(self, i: int) -> None: ...
def set_to_value(self, i: int, flag: bool) -> None: ...
def get(self, i: int) -> bool: ...
def count(self) -> int: ...
def minimum(self) -> int: ...
def maximum(self) -> int: ...
def inplace_union(self, b2: BitSet) -> bool: ...
def union_count(self, b2: BitSet) -> int: ...
def inplace_intersection(self, b2: BitSet): ...
def intersection_count(self, b2: BitSet) -> int: ...
def disjoint(self, b2: BitSet) -> bool: ...
def intersect(self, b2: BitSet) -> bool: ...
def contains_all(self, b2: BitSet) -> bool: ...
def inplace_difference(self, b2: BitSet) -> None: ...
def difference_count(self, b2: BitSet) -> int: ...
def inplace_symmetric_difference(self, b2: BitSet) -> bool: ...
def symmetric_difference_count(self, b2: BitSet) -> int: ...
def __iter__(self): ...
def for_each(self, func) -> bool: ...
def print(self) -> None: ...
```