Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use TypeIs for is_typeddict #12039

Closed
wants to merge 2 commits into from
Closed
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/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ from types import (
TracebackType,
WrapperDescriptorType,
)
from typing_extensions import Never as _Never, ParamSpec as _ParamSpec
from typing_extensions import Never as _Never, ParamSpec as _ParamSpec, TypeIs as _TypeIs

if sys.version_info >= (3, 9):
from types import GenericAlias
Expand Down Expand Up @@ -1013,7 +1013,7 @@ class ForwardRef:
def __ror__(self, other: Any) -> _SpecialForm: ...

if sys.version_info >= (3, 10):
def is_typeddict(tp: object) -> bool: ...
def is_typeddict(tp: object) -> _TypeIs[type[_TypedDict]]: ...

def _type_repr(obj: object) -> str: ...

Expand Down
2 changes: 1 addition & 1 deletion stdlib/typing_extensions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ else:
Concatenate: _SpecialForm
TypeAlias: _SpecialForm
TypeGuard: _SpecialForm
def is_typeddict(tp: object) -> bool: ...
def is_typeddict(tp: object) -> TypeIs[type[_TypedDict]]: ...

# New and changed things in 3.11
if sys.version_info >= (3, 11):
Expand Down