Repository navigation
fix: label unannotated type variables as typevars - #415
Merged
Merged
Conversation
A type variable declared as `T = TypeVar("T")`, the usual spelling, was
badged as a constant because only its annotation was inspected. The
declared value now decides, and `ParamSpec` and `TypeVarTuple` count
too, so the typing page also lists them under Type Variables. The
typevar badge gains its text and a colour of its own; it previously
rendered empty.
📚 Preview this PR's docs locallyFetch the just-built site and open it in your browser: # this exact build
great-docs preview --run 39947242659
# or always the latest build for this PR
great-docs preview --pr 415Auth & tips
|
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.
This PR gives a type variable declared without an annotation, such as
T = TypeVar("T"), atypevarbadge on its reference page. The label was read only from the annotation, so the usual spelling showedconstant, and the stylesheet had no colour or text for atypevarbadge.ParamSpec,TypeVarTupleand thetyping.TypeVarspellings get the badge too.Before:
After: