Uh oh!
There was an error while loading. Please reload this page.
typing: Improve documentation of generic classes and aliases - #105369
Conversation
| def second(l: Sequence[U]) -> U: # Function is generic around the TypeVar "U" | ||
| return l[1] |
There was a problem hiding this comment.
I figured it was slightly confusing to have two functions named first in two adjacent code examples
AlexWaygood
commented
Jun 6, 2023
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
miss-islington
commented
Jun 7, 2023
Thanks @AlexWaygood for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
miss-islington
commented
Jun 7, 2023
Sorry, @AlexWaygood, I could not cleanly backport this to |
bedevere-bot
commented
Jun 7, 2023
GH-105453 is a backport of this pull request to the 3.12 branch. |
bedevere-bot
commented
Jun 7, 2023
GH-105454 is a backport of this pull request to the 3.11 branch. |
The documentation for
typing.Dictcurrently describes the alias as:In 2023, this is pretty misleading: it implies that
dictis not generic, and that you have to usetyping.Dictif you want to supply type parameters. There are similar issues across the typing documentation for the various aliases that were deprecated as part of PEP-585.This PR also makes a few related edits to the docs for generic classes, which look like they still have some pre-PEP-585 language in them.
📚 Documentation preview 📚: https://cpython-previews--105369.org.readthedocs.build/