mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Improve .keys(), .values(), .items() methods for TypedDicts (#8532)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import _typeshed
|
||||
import collections # Needed by aliases like DefaultDict, see mypy issue 2986
|
||||
import sys
|
||||
from _collections_abc import dict_items, dict_keys, dict_values
|
||||
from _typeshed import IdentityFunction, Incomplete, SupportsKeysAndGetItem
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from contextlib import AbstractAsyncContextManager, AbstractContextManager
|
||||
@@ -797,9 +798,9 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
|
||||
def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse]
|
||||
def update(self: _T, __m: _T) -> None: ...
|
||||
def __delitem__(self, k: NoReturn) -> None: ...
|
||||
def items(self) -> ItemsView[str, object]: ...
|
||||
def keys(self) -> KeysView[str]: ...
|
||||
def values(self) -> ValuesView[object]: ...
|
||||
def items(self) -> dict_items[str, object]: ...
|
||||
def keys(self) -> dict_keys[str, object]: ...
|
||||
def values(self) -> dict_values[str, object]: ...
|
||||
if sys.version_info >= (3, 9):
|
||||
def __or__(self: _typeshed.Self, __value: _typeshed.Self) -> _typeshed.Self: ...
|
||||
def __ior__(self: _typeshed.Self, __value: _typeshed.Self) -> _typeshed.Self: ...
|
||||
|
||||
Reference in New Issue
Block a user