construct-typing/construct-stubs/lib/containers.pyi
2021-01-01 23:46:43 +01:00

24 lines
1.1 KiB
Python

import re
import typing as t
ContainerType = t.TypeVar("ContainerType")
ListType = t.TypeVar("ListType")
SearchPattern = t.Union[t.AnyStr, re.Pattern[t.AnyStr]]
class Container(t.Generic[ContainerType], dict[str, ContainerType]):
def __getattr__(self, name: str) -> ContainerType: ...
def __call__(self, **entrieskw: t.Any) -> Container[ContainerType]: ...
def keys(self) -> t.Iterator[str]: ...
def values(self) -> t.List[ContainerType]: ...
def items(self) -> t.List[t.Tuple[str, ContainerType]]: ...
def clear(self) -> None: ...
def pop(self, key: str) -> ContainerType: ...
def popitem(self) -> t.Tuple[str, ContainerType]: ...
def update(self, seqordict: t.Union[dict[str, ContainerType], t.Tuple[str, ContainerType]]) -> None: ...
def search(self, pattern: SearchPattern[t.Any]) -> t.Any: ...
def search_all(self, pattern: SearchPattern[t.Any]) -> t.Any: ...
class ListContainer(t.List[ListType]):
def search(self, pattern: SearchPattern[t.Any]) -> t.Any: ...
def search_all(self, pattern: SearchPattern[t.Any]) -> t.Any: ...