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
Miscellaneous improvements to the typing docs #105529
Conversation
Note that ``None`` as a type hint is a special case and is replaced by | ||
``type(None)``. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just doesn't fit in this section at all. Even if it did, it's incorrect: None
is treated more like Literal[None]
than NoneType
in terms of typing
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
I changed my mind about adding examples to the API references for The better solution for this problem is for |
Thanks @AlexWaygood for the PR |
Sorry, @AlexWaygood, I could not cleanly backport this to |
GH-105567 is a backport of this pull request to the 3.12 branch. |
Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative. (cherry picked from commit 8e755923c97d689ba7c7fe8deb50c1b169263264) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.
GH-105568 is a backport of this pull request to the 3.11 branch. |
1�75567) Miscellaneous improvements to the typing docs (GH-105529) Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative. (cherry picked from commit 8e75592) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Miscellaneous improvements to the typing docs (#105529) Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.
Mostly, these are changes so that we use shorter sentences and shorter paragraphs. In particular, I've tried to make the first sentence introducing each object in the typing API short and declarative.
Also, among other things:
Generic
(!)typevarobject.c
:::
to introduce code examples, so that they render properly in IDE tooltips.SyntaxError
in a code example in the docstring forLiteralString
Required
andNotRequired
. The docstrings for these special forms are currently much more informative than the docs. Although the docs do link to the docs forTypedDict
, where there's more information, I don't see any reason why we shouldn't put information where users will expect to find it.