mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-18 12:32:25 +08:00
Normalise use of Never vs NoReturn (#8549)
This commit is contained in:
@@ -127,16 +127,16 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
|
||||
__optional_keys__: ClassVar[frozenset[str]]
|
||||
__total__: ClassVar[bool]
|
||||
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 items(self) -> dict_items[str, object]: ...
|
||||
def keys(self) -> dict_keys[str, object]: ...
|
||||
def values(self) -> dict_values[str, object]: ...
|
||||
def __delitem__(self, k: NoReturn) -> None: ...
|
||||
def __delitem__(self, k: Never) -> None: ...
|
||||
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: ...
|
||||
@@ -221,9 +221,9 @@ if sys.version_info >= (3, 11):
|
||||
)
|
||||
else:
|
||||
Self: _SpecialForm
|
||||
Never: _SpecialForm
|
||||
Never: _SpecialForm = ...
|
||||
def reveal_type(__obj: _T) -> _T: ...
|
||||
def assert_never(__arg: NoReturn) -> NoReturn: ...
|
||||
def assert_never(__arg: Never) -> Never: ...
|
||||
def assert_type(__val: _T, __typ: Any) -> _T: ...
|
||||
def clear_overloads() -> None: ...
|
||||
def get_overloads(func: Callable[..., object]) -> Sequence[Callable[..., object]]: ...
|
||||
|
||||
Reference in New Issue
Block a user