Skip to content

Commit

Permalink
update work on .pyi files
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanschnell committed Jun 10, 2021
1 parent 2e0efa4 commit f8471a1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions bitarray/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from typing import (Any, BinaryIO, Iterable, MutableSequence, Optional,
Union, overload)
from collections.abc import Iterable, Iterator

from typing import Any, BinaryIO, Union, overload
from typing_extensions import Literal


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


class bitarray(MutableSequence[Bool]):
def __init__(self, initializer: Union[int, str, Iterable, None]=0,
class bitarray:
def __init__(self, initializer: Union[int, str, Iterable[Bool], None]=0,
endian: str=..., /) -> None: ...
def all(self) -> bool: ...
def any(self) -> bool: ...
Expand All @@ -38,14 +39,14 @@ class bitarray(MutableSequence[Bool]):
def insert(self, i: int, value: Bool, /) -> None: ...
def invert(self, i: int=...) -> None: ...
def iterdecode(self,
code: Union[Codedict, decodetree], /) -> Iterable[int]: ...
def itersearch(self, a: Union[bitarray, Bool], /) -> Iterable[int]: ...
code: Union[Codedict, decodetree], /) -> Iterator: ...
def itersearch(self, a: Union[bitarray, Bool], /) -> Iterator[int]: ...
def pack(self, b: bytes, /) -> None: ...
def pop(self, i: int=..., /) -> Bool: ...
def remove(self, value: Bool, /) -> None: ...
def reverse(self) -> None: ...
def search(self, a: Union[bitarray, Bool],
limit: Optional[int] = ...) -> list[int]: ...
limit: int = ...) -> list[int]: ...
def setall(self, value: Bool, /) -> None: ...
def sort(self, reverse: int) -> None: ...
def to01(self) -> str: ...
Expand All @@ -55,19 +56,19 @@ class bitarray(MutableSequence[Bool]):
def unpack(self, zero: bytes=..., one: bytes=...) -> bytes: ...

def __len__(self) -> int: ...
def __iter__(self) -> Iterator[Bool]: ...
@overload
def __getitem__(self, i: int) -> Bool: ...
@overload
def __getitem__(self, s: slice) -> bitarray: ...
@overload # type: ignore[override]
@overload
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: # type: ignore[override]
...
def __iadd__(self, other: bitarray) -> bitarray: ...
def __mul__(self, n: int) -> bitarray: ...
def __imul__(self, n: int) -> bitarray: ...
def __rmul__(self, n: int) -> bitarray: ...
Expand Down
2 changes: 1 addition & 1 deletion bitarray/util.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import BinaryIO, Literal, Optional, Union, Any, AnyStr
from typing import Any, AnyStr, BinaryIO, Literal, Optional, Union

from bitarray import bitarray

Expand Down

0 comments on commit f8471a1

Please sign in to comment.