easybits 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
easybits/__init__.py
CHANGED
@@ -25,8 +25,10 @@ class Bits(bitarray):
|
|
25
25
|
def ones(cls, length):
|
26
26
|
return Bits(ones(length))
|
27
27
|
|
28
|
-
def __new__(cls, value, length=None, encoding='ascii'):
|
29
|
-
if
|
28
|
+
def __new__(cls, value=None, length=None, encoding='ascii'):
|
29
|
+
if value is None:
|
30
|
+
bits = bitarray(length or 0)
|
31
|
+
elif isinstance(value, bytes):
|
30
32
|
bits = bitarray()
|
31
33
|
bits.frombytes(value)
|
32
34
|
elif isinstance(value, bool):
|
@@ -109,3 +111,6 @@ class Bits(bitarray):
|
|
109
111
|
return ~self + Bits(1, length=len(self))
|
110
112
|
else:
|
111
113
|
return ~(self + Bits(-1, length=len(self)))
|
114
|
+
|
115
|
+
def concat(self, other):
|
116
|
+
return super().__add__(other)
|
@@ -0,0 +1,6 @@
|
|
1
|
+
easybits/__init__.py,sha256=Hbz2irQzF8juhojdybx3S_jBX272Mgd_L1VCQIfpx6E,3286
|
2
|
+
easybits/errors.py,sha256=MPQGCYUave-PCKP4IkfIS2NJzL2j2KH2W3rlPofsigo,478
|
3
|
+
easybits/util.py,sha256=GYlFDgqk1sBkFidKsoo9xaO7QZ8_v7KFavP2KnV0mZ8,100
|
4
|
+
easybits-0.1.2.dist-info/METADATA,sha256=1prbZ3ZJEKyIh799B88gVfRJq9Og2I4aEytHsqw0Rhc,525
|
5
|
+
easybits-0.1.2.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
|
6
|
+
easybits-0.1.2.dist-info/RECORD,,
|
easybits-0.1.1.dist-info/RECORD
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
easybits/__init__.py,sha256=aOBwy6bMlijC54Ov9UVv4OW5i8jIQvuCwSOQUFkKQJ8,3144
|
2
|
-
easybits/errors.py,sha256=MPQGCYUave-PCKP4IkfIS2NJzL2j2KH2W3rlPofsigo,478
|
3
|
-
easybits/util.py,sha256=GYlFDgqk1sBkFidKsoo9xaO7QZ8_v7KFavP2KnV0mZ8,100
|
4
|
-
easybits-0.1.1.dist-info/METADATA,sha256=mY5ZZDiL-S6wHFS2NppzyITreTRHKKyGVHCgY7p-nDM,525
|
5
|
-
easybits-0.1.1.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
|
6
|
-
easybits-0.1.1.dist-info/RECORD,,
|
File without changes
|