-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Move typing-related usage of PEP585 generics from typing
docs to collections.abc
#123523
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
Labels
Comments
@JelleZijlstra, as a typing expert, does this approach seem good to you? |
As a user of collections generics, this would be quite useful, and seems appropriate now that Python 3.8 is nearing end-of-life. Happy to defer to others' views, though. A |
I think +3 on the last comment is a good enough indicator - I'll grab this and open a PR soon. |
This was referenced Aug 31, 2024
AlexWaygood
pushed a commit
that referenced
this issue
Sep 6, 2024
… and link to it from `collections.abc` docs (#123544)
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Sep 6, 2024
…tines, and link to it from `collections.abc` docs (pythonGH-123544) (cherry picked from commit 56e4a41) Co-authored-by: Stanislav Terliakov <50529348+sterliakov@users.noreply.github.com>
AlexWaygood
pushed a commit
to AlexWaygood/cpython
that referenced
this issue
Sep 6, 2024
…d coroutines, and link to it from `collections.abc` docs (python#123544)
AlexWaygood
added a commit
that referenced
this issue
Sep 6, 2024
Yhg1s
pushed a commit
that referenced
this issue
Sep 6, 2024
…utines, and link to it from `collections.abc` docs (GH-123544) (#123790) gh-123523: Rework typing documentation for generators and coroutines, and link to it from `collections.abc` docs (GH-123544) (cherry picked from commit 56e4a41) Co-authored-by: Stanislav Terliakov <50529348+sterliakov@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Documentation
As pointed out in #123521, currently we have typing-related usage of PEP585 generics (
Generator
,Callable
,Coroutine
, etc.) explained ontyping
page. However, those aliases are deprecated, and there's no backlink from theircollections.abc
counterparts.So, currently all users of the recommended modern option (
collections.abc
generics) have no documentation regarding their use in typing context at hand. Worse, classes there don't even have their generic arguments listed - only the name:This clearly should be fixed. At minimum the following needs to hold:
collections.abc
aliases have their generic arguments listed in the docstyping
docs entries should be reachable fromcollections.abc
docs.Upon some thinking I agree with @ZeroIntensity that moving all information to
collections.abc
and only retaining deprecation warning with a link intyping
docs could be the most ergonomic option.Linked PRs
collections.abc
docs #123544collections.abc
docs (GH-123544) #123790collections.abc
docs (#123544) #123792The text was updated successfully, but these errors were encountered: