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

Clarify usage of callables regarding type object in docs #15079

Merged
merged 3 commits into from May 1, 2023

Conversation

Viicos
Copy link
Contributor

@Viicos Viicos commented Apr 19, 2023

Related: #15024. Phrasing might be incorrect, I'll take reviews if required

@@ -319,7 +319,8 @@ member:
batch_proc([], bad_cb) # Error! Argument 2 has incompatible type because of
# different name and kind in the callback

Callback protocols and :py:data:`~typing.Callable` types can be used interchangeably.
Callback protocols and :py:data:`~typing.Callable` types can be used interchangeably (altough using
:py:data:`~typing.Type` on a :py:data:`~typing.Callable` might lead to unexpected results).
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without going into details, this is the reason I've added this part: https://mypy-play.net/?mypy=1.2.0&python=3.11&gist=25c2697cb3c308ae1609b0f6dc9ff0ff

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thank you!

@hauntsaninja hauntsaninja merged commit dbb72bb into python:master May 1, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants