Skip to content

[WIP] improve type annotations in 'docutils.parsers.rst.states' #11525

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

Closed

Conversation

danieleades
Copy link
Contributor

@danieleades danieleades commented Mar 3, 2024

note to reviewers: i don't love the amount of type: ignore statements I'm having to put in here to match the implementation in docutils. Would welcome input if there's a better approach

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.parsers.rst.states branch from b2ddcf2 to 698e1eb Compare March 3, 2024 10:04

This comment has been minimized.

@danieleades danieleades force-pushed the docutils.parsers.rst.states branch from dcd3f5f to 139c522 Compare March 3, 2024 11:23
@danieleades danieleades force-pushed the docutils.parsers.rst.states branch from b1a0822 to be286e0 Compare March 3, 2024 11:25
@danieleades
Copy link
Contributor Author

@JelleZijlstra I think this PR should not me merged before #11469 because the addition of generics in statemachine will impact the type annotations in this PR

@danieleades danieleades force-pushed the docutils.parsers.rst.states branch from 934e3f5 to 2c26ae8 Compare March 3, 2024 11:31

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Mar 3, 2024

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
+ sphinx/util/nodes.py:588: error: Unused "type: ignore" comment  [unused-ignore]
+ sphinx/util/docutils.py:507: error: Unused "type: ignore" comment  [unused-ignore]
- sphinx/util/docutils.py: note: In member "env" of class "SphinxRole":
- sphinx/util/docutils.py:497:16: error: "Inliner" has no attribute "document"  [attr-defined]
- sphinx/roles.py: note: In member "create_non_xref_node" of class "XRefRole":
- sphinx/roles.py:117:34: error: "Inliner" has no attribute "document"  [attr-defined]
- sphinx/roles.py: note: In member "create_xref_node" of class "XRefRole":
- sphinx/roles.py:142:34: error: "Inliner" has no attribute "document"  [attr-defined]
- sphinx/roles.py: note: In member "run" of class "PEP":
- sphinx/roles.py:182:9: error: "Inliner" has no attribute "document"  [attr-defined]
- sphinx/roles.py:193:19: error: "Inliner" has no attribute "reporter"  [attr-defined]
- sphinx/roles.py:195:19: error: "Inliner" has no attribute "problematic"  [attr-defined]
- sphinx/roles.py: note: In member "build_uri" of class "PEP":
- sphinx/roles.py:201:20: error: "Inliner" has no attribute "document"  [attr-defined]
- sphinx/roles.py: note: In member "run" of class "RFC":
- sphinx/roles.py:216:9: error: "Inliner" has no attribute "document"  [attr-defined]
- sphinx/roles.py:227:19: error: "Inliner" has no attribute "reporter"  [attr-defined]
- sphinx/roles.py:229:19: error: "Inliner" has no attribute "problematic"  [attr-defined]
- sphinx/roles.py: note: In member "build_uri" of class "RFC":
- sphinx/roles.py:235:20: error: "Inliner" has no attribute "document"  [attr-defined]
- sphinx/roles.py:238:31: error: "Inliner" has no attribute "rfc_url"  [attr-defined]
- sphinx/roles.py:240:31: error: "Inliner" has no attribute "rfc_url"  [attr-defined]

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:
+ src/bokeh/sphinxext/bokeh_palette_group.py:53: note: ... from here:

@danieleades
Copy link
Contributor Author

this rebase is beyond me. will close it and reopen a new PR

@danieleades danieleades closed this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant