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
improve type annotations in 'docutils.parsers.rst.states' #11545
Draft
danieleades
wants to merge
6
commits into
python:main
Choose a base branch
from
danieleades:docutils.parsers.rst.states
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
This comment has been minimized.
This comment has been minimized.
danieleades
force-pushed
the
docutils.parsers.rst.states
branch
from
March 8, 2024 17:48
0931869
to
f59072d
Compare
This comment has been minimized.
This comment has been minimized.
danieleades
force-pushed
the
docutils.parsers.rst.states
branch
from
March 8, 2024 18:49
32355ee
to
9b1113f
Compare
This comment has been minimized.
This comment has been minimized.
I have no idea what this means
|
22 tasks
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
danieleades
force-pushed
the
docutils.parsers.rst.states
branch
from
March 13, 2024 14:34
ac97c5c
to
2909dbc
Compare
This comment has been minimized.
This comment has been minimized.
Diff from mypy_primer, showing the effect of this PR on open source code: sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/domains/__init__.py:23: note: In module imported here:
+ sphinx/util/docutils.py: note: In member "get_source_info" of class "SphinxDirective":
+ sphinx/util/docutils.py:436:16: error: Incompatible return value type (got "Union[tuple[str, int], tuple[None, None]]", expected "tuple[str, int]") [return-value]
+ sphinx/directives/__init__.py: note: In member "run" of class "DefaultRole":
+ sphinx/directives/__init__.py:331:26: error: List item 0 has incompatible type "system_message"; expected "SystemMessage" [list-item]
- sphinx/domains/std/__init__.py: note: At top level:
- sphinx/domains/std/__init__.py:388: error: Unused "type: ignore" comment [unused-ignore]
- sphinx/ext/autodoc/directive.py:118: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/ext/autosummary/__init__.py: note: In function "get_table":
+ sphinx/ext/autosummary/__init__.py:411:57: error: Incompatible types in string interpolation (expression has type "Optional[int]", placeholder has type "Union[int, float, SupportsInt]") [str-format]
- sphinx/directives/other.py: note: At top level:
- sphinx/directives/other.py:416: error: Unused "type: ignore" comment [unused-ignore]
+ sphinx/directives/code.py: note: In member "run" of class "CodeBlock":
+ sphinx/directives/code.py:140:74: error: Argument "location" to "dedent_lines" has incompatible type "Union[tuple[str, int], tuple[None, None]]"; expected "Optional[tuple[str, int]]" [arg-type]
+ sphinx/directives/code.py: note: In member "run" of class "LiteralInclude":
+ sphinx/directives/code.py:436:48: error: Argument "location" to "read" of "LiteralIncludeReader" has incompatible type "Union[tuple[str, int], tuple[None, None]]"; expected "Optional[tuple[str, int]]" [arg-type]
- sphinx/ext/inheritance_diagram.py: note: In member "run" of class "InheritanceDiagram":
- sphinx/ext/inheritance_diagram.py:382:21: error: Item "None" of "Optional[document]" has no attribute "reporter" [union-attr]
- sphinx/ext/inheritance_diagram.py: note: At top level:
- sphinx/ext/inheritance_diagram.py:390: error: Unused "type: ignore" comment [unused-ignore]
bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/sphinxext/bokeh_palette_group.py:53: note: ... from here:
- src/bokeh/sphinxext/bokeh_palette_group.py:53: note: In module imported here:
|
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.
No description provided.