[docutils] Improve types in `docutils.io` by ekanshul · Pull Request #16260 · python/typeshed · GitHub
Skip to content

[docutils] Improve types in docutils.io - #16260

Open
ekanshul wants to merge 2 commits into
python:mainfrom
ekanshul:docutils-io-types
Open

[docutils] Improve types in docutils.io#16260
ekanshul wants to merge 2 commits into
python:mainfrom
ekanshul:docutils-io-types

Conversation

@ekanshul

Copy link
Copy Markdown
Contributor

Several attributes and parameters of the docutils.io input/output classes were Incomplete or unannotated although docutils annotates them inline. This types the encoding, error_handler, destination_path and autoclose attributes of Output/FileOutput, the ErrorOutput attributes, the path/encoding/mode parameters of the FileInput and FileOutput constructors, and the read()/write() methods of StringInput, StringOutput and FileOutput, following the annotations in docutils 0.23.

Agent used: Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

@JelleZijlstra JelleZijlstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the mypy-primer hits in Sphinx expected?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be SupportsWrite[str] | SupportsWrite[bytes] | Literal[False] to mirror the constructor parameter?

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.

3 participants