mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
add multiprocessing.managers._BaseDictProxy (#12951)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -423,12 +423,6 @@ multiprocessing.managers.BaseListProxy.__len__
|
||||
multiprocessing.managers.BaseListProxy.__reversed__
|
||||
multiprocessing.managers.BaseListProxy.reverse
|
||||
multiprocessing.managers.BaseListProxy.sort
|
||||
multiprocessing.managers.DictProxy.__iter__
|
||||
multiprocessing.managers.DictProxy.__len__
|
||||
multiprocessing.managers.DictProxy.copy
|
||||
multiprocessing.managers.DictProxy.items
|
||||
multiprocessing.managers.DictProxy.keys
|
||||
multiprocessing.managers.DictProxy.values
|
||||
|
||||
# runtime is *args, **kwargs due to a wrapper, but we have more accurate signatures in the stubs
|
||||
multiprocessing.managers.SyncManager.Event
|
||||
|
||||
@@ -230,6 +230,15 @@ importlib.abc.Traversable.open
|
||||
importlib.metadata.DeprecatedList.reverse
|
||||
importlib.metadata.DeprecatedList.sort
|
||||
|
||||
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
|
||||
# But have more precise (accurate) signatures in the stub
|
||||
multiprocessing.managers.DictProxy.__iter__
|
||||
multiprocessing.managers.DictProxy.__len__
|
||||
multiprocessing.managers.DictProxy.copy
|
||||
multiprocessing.managers.DictProxy.items
|
||||
multiprocessing.managers.DictProxy.keys
|
||||
multiprocessing.managers.DictProxy.values
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\.NamedTuple
|
||||
typing\.Annotated
|
||||
|
||||
@@ -184,6 +184,15 @@ importlib.resources.abc.Traversable.open
|
||||
importlib.metadata.DeprecatedList.reverse
|
||||
importlib.metadata.DeprecatedList.sort
|
||||
|
||||
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
|
||||
# But have more precise (accurate) signatures in the stub
|
||||
multiprocessing.managers.DictProxy.__iter__
|
||||
multiprocessing.managers.DictProxy.__len__
|
||||
multiprocessing.managers.DictProxy.copy
|
||||
multiprocessing.managers.DictProxy.items
|
||||
multiprocessing.managers.DictProxy.keys
|
||||
multiprocessing.managers.DictProxy.values
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\._SpecialForm.*
|
||||
typing\.NamedTuple
|
||||
|
||||
@@ -174,6 +174,15 @@ importlib.resources.abc.Traversable.open
|
||||
# Deprecation wrapper classes; their methods are just pass-through, so we can ignore them.
|
||||
importlib.metadata.DeprecatedNonAbstract.__new__
|
||||
|
||||
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
|
||||
# But have more precise (accurate) signatures in the stub
|
||||
multiprocessing.managers.DictProxy.__iter__
|
||||
multiprocessing.managers.DictProxy.__len__
|
||||
multiprocessing.managers.DictProxy.copy
|
||||
multiprocessing.managers.DictProxy.items
|
||||
multiprocessing.managers.DictProxy.keys
|
||||
multiprocessing.managers.DictProxy.values
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\._SpecialForm.*
|
||||
typing\.NamedTuple
|
||||
|
||||
@@ -150,6 +150,17 @@ importlib.resources.abc.Traversable.open
|
||||
# Deprecation wrapper classes; their methods are just pass-through, so we can ignore them.
|
||||
importlib.metadata.DeprecatedNonAbstract.__new__
|
||||
|
||||
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
|
||||
# But have more precise (accurate) signatures in the stub
|
||||
multiprocessing.managers._BaseDictProxy.__iter__
|
||||
multiprocessing.managers._BaseDictProxy.__len__
|
||||
multiprocessing.managers._BaseDictProxy.clear
|
||||
multiprocessing.managers._BaseDictProxy.copy
|
||||
multiprocessing.managers._BaseDictProxy.items
|
||||
multiprocessing.managers._BaseDictProxy.keys
|
||||
multiprocessing.managers._BaseDictProxy.popitem
|
||||
multiprocessing.managers._BaseDictProxy.values
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\._SpecialForm.*
|
||||
typing\.NamedTuple
|
||||
|
||||
@@ -266,3 +266,12 @@ email.utils.parseaddr
|
||||
# Weird special builtins that are typed as functions, but aren't functions
|
||||
hashlib.sha3_\d+ # Class in 3.8, can't be subclassed at runtime, built-in function 3.9+
|
||||
hashlib.shake_\d+ # Class in 3.8, can't be subclassed at runtime, built-in function 3.9+
|
||||
|
||||
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
|
||||
# But have more precise (accurate) signatures in the stub
|
||||
multiprocessing.managers.DictProxy.__iter__
|
||||
multiprocessing.managers.DictProxy.__len__
|
||||
multiprocessing.managers.DictProxy.copy
|
||||
multiprocessing.managers.DictProxy.items
|
||||
multiprocessing.managers.DictProxy.keys
|
||||
multiprocessing.managers.DictProxy.values
|
||||
|
||||
@@ -204,6 +204,15 @@ multiprocessing.managers.DictProxy.popitem
|
||||
# Problematic protocol signature at runtime, see source code comments.
|
||||
importlib.abc.Traversable.open
|
||||
|
||||
# These multiprocessing proxy methods have *args, **kwargs signatures at runtime,
|
||||
# But have more precise (accurate) signatures in the stub
|
||||
multiprocessing.managers.DictProxy.__iter__
|
||||
multiprocessing.managers.DictProxy.__len__
|
||||
multiprocessing.managers.DictProxy.copy
|
||||
multiprocessing.managers.DictProxy.items
|
||||
multiprocessing.managers.DictProxy.keys
|
||||
multiprocessing.managers.DictProxy.values
|
||||
|
||||
# Super-special typing primitives
|
||||
typing\.NamedTuple
|
||||
typing\.Annotated
|
||||
|
||||
@@ -61,31 +61,58 @@ class ValueProxy(BaseProxy, Generic[_T]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
|
||||
|
||||
class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
|
||||
__builtins__: ClassVar[dict[str, Any]]
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, key: _KT, /) -> _VT: ...
|
||||
def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
|
||||
def __delitem__(self, key: _KT, /) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def copy(self) -> dict[_KT, _VT]: ...
|
||||
@overload # type: ignore[override]
|
||||
def get(self, key: _KT, /) -> _VT | None: ...
|
||||
@overload
|
||||
def get(self, key: _KT, default: _VT, /) -> _VT: ...
|
||||
@overload
|
||||
def get(self, key: _KT, default: _T, /) -> _VT | _T: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, /) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT, /) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _T, /) -> _VT | _T: ...
|
||||
def keys(self) -> list[_KT]: ... # type: ignore[override]
|
||||
def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override]
|
||||
def values(self) -> list[_VT]: ... # type: ignore[override]
|
||||
if sys.version_info >= (3, 13):
|
||||
def __class_getitem__(cls, args: Any, /) -> Any: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
class _BaseDictProxy(BaseProxy, MutableMapping[_KT, _VT]):
|
||||
__builtins__: ClassVar[dict[str, Any]]
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, key: _KT, /) -> _VT: ...
|
||||
def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
|
||||
def __delitem__(self, key: _KT, /) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def copy(self) -> dict[_KT, _VT]: ...
|
||||
@overload # type: ignore[override]
|
||||
def get(self, key: _KT, /) -> _VT | None: ...
|
||||
@overload
|
||||
def get(self, key: _KT, default: _VT, /) -> _VT: ...
|
||||
@overload
|
||||
def get(self, key: _KT, default: _T, /) -> _VT | _T: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, /) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT, /) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _T, /) -> _VT | _T: ...
|
||||
def keys(self) -> list[_KT]: ... # type: ignore[override]
|
||||
def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override]
|
||||
def values(self) -> list[_VT]: ... # type: ignore[override]
|
||||
|
||||
class DictProxy(_BaseDictProxy[_KT, _VT]):
|
||||
def __class_getitem__(cls, args: Any, /) -> GenericAlias: ...
|
||||
|
||||
else:
|
||||
class DictProxy(BaseProxy, MutableMapping[_KT, _VT]):
|
||||
__builtins__: ClassVar[dict[str, Any]]
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, key: _KT, /) -> _VT: ...
|
||||
def __setitem__(self, key: _KT, value: _VT, /) -> None: ...
|
||||
def __delitem__(self, key: _KT, /) -> None: ...
|
||||
def __iter__(self) -> Iterator[_KT]: ...
|
||||
def copy(self) -> dict[_KT, _VT]: ...
|
||||
@overload # type: ignore[override]
|
||||
def get(self, key: _KT, /) -> _VT | None: ...
|
||||
@overload
|
||||
def get(self, key: _KT, default: _VT, /) -> _VT: ...
|
||||
@overload
|
||||
def get(self, key: _KT, default: _T, /) -> _VT | _T: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, /) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _VT, /) -> _VT: ...
|
||||
@overload
|
||||
def pop(self, key: _KT, default: _T, /) -> _VT | _T: ...
|
||||
def keys(self) -> list[_KT]: ... # type: ignore[override]
|
||||
def items(self) -> list[tuple[_KT, _VT]]: ... # type: ignore[override]
|
||||
def values(self) -> list[_VT]: ... # type: ignore[override]
|
||||
|
||||
class BaseListProxy(BaseProxy, MutableSequence[_T]):
|
||||
__builtins__: ClassVar[dict[str, Any]]
|
||||
|
||||
Reference in New Issue
Block a user