Skip to content

Commit

Permalink
subclass from MutableSequence
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanschnell committed Jun 10, 2021
1 parent 83d47de commit eb6ba2f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bitarray/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, BinaryIO, Iterable, Optional, Union, overload
from typing import (Any, BinaryIO, Iterable, MutableSequence, Optional,
Union, overload)
from typing_extensions import Literal


Expand All @@ -12,7 +13,7 @@ class decodetree:
def todict(self) -> Codedict: ...


class bitarray:
class bitarray(MutableSequence[Bool]):
def __init__(self, initializer: Union[int, str, Iterable, None]=0,
endian: str=..., /) -> None: ...
def all(self) -> bool: ...
Expand Down Expand Up @@ -58,14 +59,15 @@ class bitarray:
def __getitem__(self, i: int) -> Bool: ...
@overload
def __getitem__(self, s: slice) -> bitarray: ...
@overload
@overload # type: ignore # Overrides MutableSequence
def __setitem__(self, i: Union[int, slice], o: Bool) -> None: ...
@overload
def __setitem__(self, s: slice, o: bitarray) -> None: ...
def __delitem__(self, i: Union[int, slice]) -> None: ...

def __add__(self, other: bitarray) -> bitarray: ...
def __iadd__(self, other: bitarray) -> bitarray: ...
def __iadd__(self, other: bitarray) -> bitarray: # type: ignore
... # Overrides MutableSequence
def __mul__(self, n: int) -> bitarray: ...
def __imul__(self, n: int) -> bitarray: ...
def __rmul__(self, n: int) -> bitarray: ...
Expand Down

0 comments on commit eb6ba2f

Please sign in to comment.