Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions stdlib/asyncio/mixins.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
import threading
from typing import NoReturn
from typing_extensions import Never

_global_lock: threading.Lock

class _LoopBoundMixin:
if sys.version_info < (3, 11):
def __init__(self, *, loop: NoReturn = ...) -> None: ...
def __init__(self, *, loop: Never = ...) -> None: ...
10 changes: 5 additions & 5 deletions stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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]: ...
Expand Down
12 changes: 6 additions & 6 deletions stdlib/typing_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down Expand Up @@ -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]]: ...
Expand Down
9 changes: 5 additions & 4 deletions stubs/mypy-extensions/mypy_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ from _collections_abc import dict_items, dict_keys, dict_values
from _typeshed import IdentityFunction, Self
from collections.abc import Mapping
from typing import Any, ClassVar, Generic, TypeVar, overload, type_check_only
from typing_extensions import Never

_T = TypeVar("_T")
_U = TypeVar("_U")
Expand All @@ -16,16 +17,16 @@ class _TypedDict(Mapping[str, object], metaclass=abc.ABCMeta):
# Unlike typing(_extensions).TypedDict,
# subclasses of mypy_extensions.TypedDict do NOT have the __required_keys__ and __optional_keys__ ClassVars
def copy(self: Self) -> 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: Self, __m: Self) -> 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: Self, __other: Self) -> Self: ...
def __ior__(self: Self, __other: Self) -> Self: ...
Expand Down