easybits 0.1.1__tar.gz → 0.1.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: easybits
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: A friendly interface for exploring bits.
5
5
  Author: Chris Proctor
6
6
  Author-email: chris@chrisproctor.net
@@ -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 isinstance(value, bytes):
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)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "easybits"
3
- version = "0.1.1"
3
+ version = "0.1.2"
4
4
  description = "A friendly interface for exploring bits."
5
5
  authors = ["Chris Proctor <chris@chrisproctor.net>"]
6
6
  readme = "README.md"
File without changes
File without changes
File without changes