docs: remove broken LiteralString overloads example (closes #2090)#2311
Open
ashishpatel26 wants to merge 1 commit into
Open
docs: remove broken LiteralString overloads example (closes #2090)#2311ashishpatel26 wants to merge 1 commit into
ashishpatel26 wants to merge 1 commit into
Conversation
The "Interactions with Overloads" section under LiteralString contained an example that does not typecheck in pyright (and other checkers) because the `Literal["foo"]` and `LiteralString` overloads overlap unsafely. The section specified no normative behavior — it was purely illustrative — so the cleanest fix is to remove it. Also drop the `See :ref:\`literalstring-overloads\`` back-reference from the preceding Literal-type note, since the target no longer exists. Fixes: python#2090
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.
Summary
Fixes #2090.
The
LiteralString"Interactions with Overloads" section contained an overload example that type checkers flag as unsafe overlaps (e.g. pyright errors becauseLiteral["foo"]is a subtype ofLiteralString, making the two overloads ambiguous). The section specified no normative behaviour — it was purely illustrative — so the simplest correct fix is removal, as suggested by @JelleZijlstra in the issue.Also removes the
See :ref:\literalstring-overloads`cross-reference in the precedingLiteral` note (the target no longer exists).Changes
docs/spec/literal.rst: delete the 24-line "Interactions with Overloads" sub-section and its anchor; drop the staleSee :ref:from the Literal note.Test plan
make html(or ReadTheDocs build) succeeds with no broken-reference warnings