Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[docutils] Add missing stubs forwriters dir#14223

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
donBarbos wants to merge6 commits intopython:main
base:main
Choose a base branch
Loading
fromdonBarbos:improve-docutils-writers

Conversation

donBarbos
Copy link
Contributor

No description provided.

@donBarbosdonBarbos marked this pull request as ready for reviewJune 5, 2025 16:18
@donBarbosdonBarbos changed the title[docutils]: Add missing stubs forwriters dir[docutils] Add missing stubs forwriters dirJun 5, 2025
@github-actionsGitHub Actions

This comment has been minimized.

@github-actionsGitHub Actions

This comment has been minimized.

@github-actionsGitHub Actions

This comment has been minimized.

@srittau
Copy link
Collaborator

See my comment about visit methods in#14234: We should probably just add them toNodeVisitor with standard types and leave them alone in sub-classes (unless those sub-classes do anything fancy with them).

@donBarbos
Copy link
ContributorAuthor

See my comment about visit methods in#14234: We should probably just add them toNodeVisitor with standard types and leave them alone in sub-classes (unless those sub-classes do anything fancy with them).

Judging by mypy primer output, there is only one mismatched override visit method -visit_comment, and there is a comment about it (sphinx source code comment)

@github-actionsGitHub Actions
Copy link
Contributor

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

sphinx (https://github.com/sphinx-doc/sphinx)+ sphinx/writers/html5.py:44: error: Unused "type: ignore" comment  [unused-ignore]+ sphinx/writers/html5.py: note: In member "visit_reference" of class "HTML5Translator":+ sphinx/writers/html5.py:350:57: error: Argument 4 to "starttag" of "HTMLTranslator" has incompatible type "**dict[str, str]"; expected "bool"  [arg-type]+ sphinx/writers/html5.py: note: In member "visit_comment" of class "HTML5Translator":+ sphinx/writers/html5.py:364:5: error: Signature of "visit_comment" incompatible with supertype "HTMLTranslator"  [override]+ sphinx/writers/html5.py:364:5: note:      Superclass:+ sphinx/writers/html5.py:364:5: note:          def visit_comment(self, node: comment, sub: Callable[[str, str], str] = ...) -> None+ sphinx/writers/html5.py:364:5: note:      Subclass:+ sphinx/writers/html5.py:364:5: note:          def visit_comment(self, node: Element) -> None+ sphinx/writers/html5.py: note: In member "visit_admonition" of class "HTML5Translator":+ sphinx/writers/html5.py:376:73: error: Argument 4 to "starttag" of "HTMLTranslator" has incompatible type "**dict[str, str]"; expected "bool"  [arg-type]+ sphinx/writers/html5.py: note: In member "visit_download_reference" of class "HTML5Translator":+ sphinx/writers/html5.py:727:61: error: Argument 4 to "starttag" of "HTMLTranslator" has incompatible type "**dict[str, str]"; expected "bool"  [arg-type]+ sphinx/writers/html5.py:734:61: error: Argument 4 to "starttag" of "HTMLTranslator" has incompatible type "**dict[str, str]"; expected "bool"  [arg-type]+ sphinx/writers/html5.py: note: In member "visit_abbreviation" of class "HTML5Translator":+ sphinx/writers/html5.py:911:60: error: Argument 4 to "starttag" of "HTMLTranslator" has incompatible type "**dict[str, str]"; expected "bool"  [arg-type]+ sphinx/writers/html5.py: note: In member "visit_table" of class "HTML5Translator":+ sphinx/writers/html5.py:936:71: error: Argument 4 to "starttag" of "HTMLTranslator" has incompatible type "**dict[str, str]"; expected "bool"  [arg-type]+ sphinx/writers/html.py:23: error: Unused "type: ignore" comment  [unused-ignore]+ sphinx/writers/html.py: note: In member "translate" of class "HTMLWriter":+ sphinx/writers/html.py:36:9: error: Item "None" of "document | None" has no attribute "walkabout"  [union-attr]+ sphinx/writers/xml.py:15: error: Unused "type: ignore" comment  [unused-ignore]+ sphinx/writers/xml.py: note: In member "translate" of class "XMLWriter":+ sphinx/writers/xml.py:24:9: error: Item "None" of "document | None" has no attribute "settings"  [union-attr]+ sphinx/writers/xml.py:27:9: error: Item "None" of "document | None" has no attribute "settings"  [union-attr]+ sphinx/writers/xml.py:28:9: error: Item "None" of "document | None" has no attribute "settings"  [union-attr]+ sphinx/writers/xml.py:32:9: error: Incompatible types in assignment (expression has type "NodeVisitor", variable has type "XMLTranslator")  [assignment]+ sphinx/writers/xml.py:33:9: error: Item "None" of "document | None" has no attribute "walkabout"  [union-attr]+ sphinx/writers/xml.py: note: At top level:+ sphinx/writers/xml.py:37: error: Unused "type: ignore" comment  [unused-ignore]+ sphinx/writers/xml.py: note: In member "translate" of class "PseudoXMLWriter":+ sphinx/writers/xml.py:52:23: error: Item "None" of "document | None" has no attribute "pformat"  [union-attr]+ sphinx/writers/manpage.py:28: error: Unused "type: ignore" comment  [unused-ignore]+ sphinx/writers/manpage.py: note: In member "translate" of class "ManualPageWriter":+ sphinx/writers/manpage.py:34:43: error: Argument 1 to "NestedInlineTransform" has incompatible type "document | None"; expected "document"  [arg-type]+ sphinx/writers/manpage.py:38:9: error: Item "None" of "document | None" has no attribute "walkabout"  [union-attr]+ sphinx/builders/xml.py: note: In member "_translate" of class "XMLBuilder":+ sphinx/builders/xml.py:90:34: error: Incompatible types in assignment (expression has type "NodeVisitor", variable has type "XMLTranslator")  [assignment]

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@donBarbos@srittau

[8]ページ先頭

©2009-2025 Movatter.jp