Add __init__ to MappingView and its subclasses (#3528)

While these implementations don't matter for the 'typing' module
itself, these are also imported to serve as the implementations
for the 'collection.abc' module.

Fixes #3029
This commit is contained in:
Maarten ter Huurne
2019-12-21 23:45:17 +01:00
committed by Jelle Zijlstra
parent 462f71a212
commit 703b01dd5e

View File

@@ -339,10 +339,12 @@ class MutableSet(AbstractSet[_T], Generic[_T]):
def __ixor__(self, s: AbstractSet[_S]) -> MutableSet[Union[_T, _S]]: ...
def __isub__(self, s: AbstractSet[Any]) -> MutableSet[_T]: ...
class MappingView:
class MappingView(Sized):
def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
def __len__(self) -> int: ...
class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co, _VT_co]):
def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
def __and__(self, o: Iterable[Any]) -> Set[Tuple[_KT_co, _VT_co]]: ...
def __rand__(self, o: Iterable[_T]) -> Set[_T]: ...
def __contains__(self, o: object) -> bool: ...
@@ -357,6 +359,7 @@ class ItemsView(MappingView, AbstractSet[Tuple[_KT_co, _VT_co]], Generic[_KT_co,
def __rxor__(self, o: Iterable[_T]) -> Set[Union[Tuple[_KT_co, _VT_co], _T]]: ...
class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]):
def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
def __and__(self, o: Iterable[Any]) -> Set[_KT_co]: ...
def __rand__(self, o: Iterable[_T]) -> Set[_T]: ...
def __contains__(self, o: object) -> bool: ...
@@ -371,6 +374,7 @@ class KeysView(MappingView, AbstractSet[_KT_co], Generic[_KT_co]):
def __rxor__(self, o: Iterable[_T]) -> Set[Union[_KT_co, _T]]: ...
class ValuesView(MappingView, Iterable[_VT_co], Generic[_VT_co]):
def __init__(self, mapping: Mapping[_KT_co, _VT_co]) -> None: ... # undocumented
def __contains__(self, o: object) -> bool: ...
def __iter__(self) -> Iterator[_VT_co]: ...
if sys.version_info >= (3, 8):