GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add typing interface file and type hints for `backends.backend_pdf` by myzhang1029 · Pull Request #31854 · matplotlib/matplotlib

Conversation

@myzhang1029

@myzhang1029 myzhang1029 commented Jun 6, 2026

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

  • [N/A] "closes #0000" is in the body of the PR description to link the related issue
  • new and changed code is tested
  • [N/A] Plotting related features are demonstrated in an example
  • [N/A] New Features and API Changes are noted with a directive and release note
  • [N/A] Documentation complies with general and docstring guidelines

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added the first-contribution label Jun 6, 2026
@github-project-automation github-project-automation Bot added this to First Time Contributors Jun 6, 2026
@myzhang1029
Add pyi and some type hints for backend_pdf
8cfff73
@myzhang1029
myzhang1029 force-pushed the types-backend_pdf branch from f0cee2f to 8cfff73 Compare June 6, 2026 20:50
myzhang1029 added 2 commits June 6, 2026 17:32
@myzhang1029
Type all return types
61e2974
@myzhang1029
Finish all type hints
b67f186
@myzhang1029
myzhang1029 marked this pull request as ready for review June 6, 2026 22:35
timhoffm
timhoffm reviewed Jun 9, 2026
View reviewed changes

@timhoffm timhoffm left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for the PR!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/matplotlib/backends/backend_pdf.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/matplotlib/backends/backend_pdf.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/matplotlib/backends/backend_pdf.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/matplotlib/backends/backend_pdf.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/matplotlib/backends/backend_pdf.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread lib/matplotlib/backends/backend_pdf.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

timhoffm
timhoffm reviewed Jun 9, 2026
View reviewed changes
Comment thread lib/matplotlib/backends/backend_pdf.pyi Resolved

Uh oh!

There was an error while loading. Please reload this page.

myzhang1029 added 5 commits June 9, 2026 19:52
@myzhang1029
Resolve some comments
49807fc
@myzhang1029
Update filename types
6bff1ea
@myzhang1029
Apply the _RectangleType TypeAlias to an argument
8d7811a
@myzhang1029
Type alpha and effective_alphas correctly
7b6bfc5
@myzhang1029
Remove unused import
8ea26dc
timhoffm
timhoffm approved these changes Jun 10, 2026
View reviewed changes
@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

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this to Merged in First Time Contributors Jun 10, 2026
@timhoffm

timhoffm commented Jun 10, 2026

Copy link
Copy Markdown
Member

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

myzhang1029 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@myzhang1029
myzhang1029 deleted the types-backend_pdf branch June 10, 2026 16:05
@timhoffm timhoffm mentioned this pull request Jun 10, 2026
MNT: Make get_default_filetype a classmethod #31867
Merged
@myzhang1029 myzhang1029 mentioned this pull request Jun 12, 2026
MNT: add @classmethod and remove ignore post #31867 #31884
Merged
1 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@timhoffm timhoffm timhoffm approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

first-contribution

Projects

First Time Contributors
Status: Merged

Milestone

v3.11.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@myzhang1029 @timhoffm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.