Skip to content
Open
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
2 changes: 1 addition & 1 deletion stdlib/typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ class _SpecialForm(_Final):

Union: _SpecialForm
Protocol: _SpecialForm
Callable: _SpecialForm
Type: _SpecialForm
NoReturn: _SpecialForm
ClassVar: _SpecialForm
Expand Down Expand Up @@ -424,6 +423,7 @@ class _Alias:
# Class for defining generic aliases for library types.
def __getitem__(self, typeargs: Any) -> Any: ...

Callable = _Alias()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does sort of make me wonder... an alias to what? For all other _Aliases in typeshed, ty is able to defer to an "actual class somewhere else" for that _Alias's semantics in type annotations etc.. But here there is no "actual class somewhere else" -- collections.abc.Callable is just a re-export of this symbol.

(I realise that you've done it this way because you tried the first way and it was much more disruptive...)

Copy link
Contributor Author

@KotlinIsland KotlinIsland Sep 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see, i have addressed this in a comment in the "Conversion" tab

one option would be to introduce a _Callable[**P, R] definition

List = _Alias()
Dict = _Alias()
DefaultDict = _Alias()
Expand Down
Loading