Skip to content
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

Add BytesIO alias to fix missing references in docs #7737

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@

intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}

# io.BytesIO is incorrectly converted to _io.BytesIO, this alias prevents that
autodoc_type_aliases = {
"BytesIO": "~io.BytesIO",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"BytesIO": "~io.BytesIO",
"BytesIO": "io.BytesIO",

I find that the tilde isn't necessary? radarhere@f698cb9 / https://github.com/radarhere/Pillow/actions/runs/7599204419/job/20695972684

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tilde is for consistency with other types.
With the tilde:
image

Without the tilde:
image

Compare with e.g. typing.BinaryIO:
image

}

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
Expand Down