mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-27 05:12:10 +08:00
Normalise use of Never vs NoReturn (#8549)
This commit is contained in:
@@ -18,7 +18,7 @@ from types import (
|
||||
TracebackType,
|
||||
WrapperDescriptorType,
|
||||
)
|
||||
from typing_extensions import ParamSpec as _ParamSpec, final as _final
|
||||
from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, final as _final
|
||||
|
||||
__all__ = [
|
||||
"AbstractSet",
|
||||
@@ -791,13 +791,13 @@ class _TypedDict(Mapping[str, object], metaclass=ABCMeta):
|
||||
__required_keys__: ClassVar[frozenset[str]]
|
||||
__optional_keys__: ClassVar[frozenset[str]]
|
||||
def copy(self: _typeshed.Self) -> _typeshed.Self: ...
|
||||
# Using NoReturn so that only calls using mypy plugin hook that specialize the signature
|
||||
# Using Never so that only calls using mypy plugin hook that specialize the signature
|
||||
# can go through.
|
||||
def setdefault(self, k: NoReturn, default: object) -> object: ...
|
||||
def setdefault(self, k: _Never, default: object) -> object: ...
|
||||
# Mypy plugin hook for 'pop' expects that 'default' has a type variable type.
|
||||
def pop(self, k: NoReturn, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse]
|
||||
def pop(self, k: _Never, default: _T = ...) -> object: ... # pyright: ignore[reportInvalidTypeVarUse]
|
||||
def update(self: _T, __m: _T) -> None: ...
|
||||
def __delitem__(self, k: NoReturn) -> None: ...
|
||||
def __delitem__(self, k: _Never) -> None: ...
|
||||
def items(self) -> dict_items[str, object]: ...
|
||||
def keys(self) -> dict_keys[str, object]: ...
|
||||
def values(self) -> dict_values[str, object]: ...
|
||||
|
||||
Reference in New Issue
Block a user