From eb6ba2f3ad9ee783444e3fc8c5643d6bbbf552ff Mon Sep 17 00:00:00 2001 From: Ilan Schnell Date: Wed, 9 Jun 2021 23:23:28 -0500 Subject: [PATCH] subclass from MutableSequence --- bitarray/__init__.pyi | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bitarray/__init__.pyi b/bitarray/__init__.pyi index d09e1cac..1ab6fabf 100644 --- a/bitarray/__init__.pyi +++ b/bitarray/__init__.pyi @@ -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 @@ -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: ... @@ -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: ...