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
8 changes: 8 additions & 0 deletions stdlib/@tests/test_cases/builtins/check_type.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from typing_extensions import assert_type


class Meta(type): ...


call = Meta.__dict__["__call__"]

# Regression tests for https://github.com/python/typeshed/pull/16299
assert_type(int.__subclasses__(), list[type[int]])
assert_type(str.__subclasses__(), list[type[str]])
assert_type(BaseException.__subclasses__(), list[type[BaseException]])
2 changes: 1 addition & 1 deletion stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class type:
) -> _typeshed.Self: ...

def __call__(self, *args: Any, **kwds: Any) -> Any: ...
def __subclasses__(self: _typeshed.Self) -> list[_typeshed.Self]: ...
def __subclasses__(self: type[_T]) -> list[type[_T]]: ...
# Note: the documentation doesn't specify what the return type is, the standard
# implementation seems to be returning a list.
def mro(self) -> list[type]: ...
Expand Down