Skip to content

Commit

Permalink
add dict.{keys,values,items}().mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
KotlinIsland committed Sep 16, 2021
1 parent e4c2c0f commit ac61939
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from _typeshed import (
)
from ast import AST, mod
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
from types import CodeType, TracebackType
from types import CodeType, MappingProxyType, TracebackType
from typing import (
IO,
AbstractSet,
Expand Down Expand Up @@ -787,6 +787,18 @@ class list(MutableSequence[_T], Generic[_T]):
if sys.version_info >= (3, 9):
def __class_getitem__(cls, item: Any) -> GenericAlias: ...

class _dict_keys(KeysView[_KT], Generic[_KT, _VT]):
if sys.version_info >= (3, 10):
mapping: MappingProxyType[_KT, _VT]

class _dict_values(ValuesView[_VT], Generic[_KT, _VT]):
if sys.version_info >= (3, 10):
mapping: MappingProxyType[_KT, _VT]

class _dict_items(ItemsView[_VT], Generic[_KT, _VT]):
if sys.version_info >= (3, 10):
mapping: MappingProxyType[_KT, _VT]

class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
@overload
def __init__(self: dict[_KT, _VT]) -> None: ...
Expand All @@ -807,9 +819,9 @@ class dict(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
def update(self, __m: Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None: ...
@overload
def update(self, **kwargs: _VT) -> None: ...
def keys(self) -> KeysView[_KT]: ...
def values(self) -> ValuesView[_VT]: ...
def items(self) -> ItemsView[_KT, _VT]: ...
def keys(self) -> _dict_keys[_KT, _VT]: ...
def values(self) -> _dict_values[_KT, _VT]: ...
def items(self) -> _dict_items[_KT, _VT]: ...
@classmethod
@overload
def fromkeys(cls, __iterable: Iterable[_T], __value: None = ...) -> dict[_T, Any | None]: ...
Expand Down

0 comments on commit ac61939

Please sign in to comment.