Skip to content

Commit

Permalink
feat: define == operator
Browse files Browse the repository at this point in the history
  • Loading branch information
william-silversmith committed Jul 22, 2024
1 parent 65fdfc2 commit e0cf298
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crackle/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def renumber(self, start:int = 0) -> bytes:
def decompress(self, label:Optional[int] = None) -> bytes:
return decompress(self.binary, label)

def __eq__(self, other:int) -> bool:
return self.min() == other and self.max() == other

def __add__(self, other:int) -> bytes:
return CrackleArray(add_scalar(self.binary, other))

Expand Down

0 comments on commit e0cf298

Please sign in to comment.