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

Update cheat_sheet_py3.rst 2 properly xplain Callable #15613

Closed
wants to merge 1 commit into from

Conversation

cheseremtitus24
Copy link

There was a bit of a gap as to which part are the input and where the return type is.

(Explain how this PR changes mypy.)

There was a bit of a gap as to which part are the input and where the return type is.
@@ -109,8 +109,11 @@ Functions
x.anything() + 1 + "string" # no errors

# This is how you annotate a callable (function) value
Copy link
Author

Choose a reason for hiding this comment

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

Explanation on which values are the inputs of a function and which one is the return type of the function is a little ambiguous for newbies who are skimming through the cheatsheet.

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.

Thanks for working on the docs! I think in this cheatsheet, we've been conscious to "show not tell", and leave prose explanations for dedicated sections in the docs. Maybe we could re-use a function from above and say x: Callable[[str, int], None] = show

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.

2 participants