Conversation
…sary The glossary defined the term only as the functools.singledispatch kind of function, but the language reference uses the same name for a function parameterized by type variables. Split the entry so that each meaning points at its own documentation, and describe the second one by what it does rather than by the PEP 695 syntax alone, since the older typing.TypeVar spelling means the same thing. The dispatch wording is word for word what it was; its lines are rewrapped only because the text now sits two columns further in.
Documentation build overview
|
JelleZijlstra
approved these changes
Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #110195.
The glossary defines "generic function" only as the singledispatch kind, which as @JelleZijlstra put it is consistent with the
functoolsdocs but not with the language reference, where the same words mean a PEP 695 function with a type parameter list. A reader who lands on the glossary from the reference gets the wrong answer.The entry now carries both meanings as two bullets, the dispatch one first since it was there already and is unchanged. The second points at
generic-functionsin the reference and at PEP 695, and mentions that explicitTypeVarobjects were the only way before 3.12, since plenty of code still looks like that.I left
generic typealone — it already describes the parameterized-type side, so the class half of the issue title seems covered. Say the word if you would rather it grew a similar split.Glossary only, no runtime change, so no news entry.