Skip to content

Add typing interface file and type hints for backends.backend_pdf#31854

Merged
timhoffm merged 8 commits into
matplotlib:mainfrom
myzhang1029:types-backend_pdf
Jun 10, 2026
Merged

Add typing interface file and type hints for backends.backend_pdf#31854
timhoffm merged 8 commits into
matplotlib:mainfrom
myzhang1029:types-backend_pdf

Conversation

@myzhang1029

Copy link
Copy Markdown
Contributor

PR summary

This PR is modeled against #30126, but hopefully it's a more targeted patch that doesn't get stalled.

This pull request adds .pyi files for the matplotlib.backends.backend_pdf module.

Why this change is necessary: To allow static type checkers like mypy to process this module (in particular, my use case is mainly around PdfFile and PdfPages).

AI Disclosure

No AI involved yet.

PR checklist

Parts of the (presumably mostly internal) methods are left untyped at the moment.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process.

You can also join us on discourse chat for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide.
Please let us know if (and how) you use AI, it will help us give you better feedback on your PR.

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@myzhang1029 myzhang1029 marked this pull request as ready for review June 6, 2026 22:35

@timhoffm timhoffm 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.

Thanks for the PR!

Comment thread lib/matplotlib/backends/backend_pdf.pyi Outdated
Comment thread lib/matplotlib/backends/backend_pdf.pyi
Comment thread lib/matplotlib/backends/backend_pdf.pyi Outdated
Comment thread lib/matplotlib/backends/backend_pdf.pyi Outdated
Comment thread lib/matplotlib/backends/backend_pdf.pyi Outdated
Comment thread lib/matplotlib/backends/backend_pdf.pyi Outdated
Comment thread lib/matplotlib/backends/backend_pdf.pyi
@timhoffm timhoffm added this to the v3.11.0 milestone Jun 10, 2026
@timhoffm timhoffm merged commit 8f215c4 into matplotlib:main Jun 10, 2026
37 of 38 checks passed
@timhoffm

Copy link
Copy Markdown
Member

Thanks @myzhang1029, and congratulations on your first contribution to Matplotlib! 🎉 We hope to see you back.

@myzhang1029 myzhang1029 deleted the types-backend_pdf branch June 10, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

2 participants