GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — TYP,BLD: Fix backend_pdf stub errors and install it by maaz7409 · Pull Request #32586 · matplotlib/matplotlib Conversation
Contributor
PR summaryThis PR is follow-up to #32481, which installed Fixes
I checked with mypy and stubtest (16 → 1 mypy errors on valid usage, 23 → 18 stubtest differences, none from the changed items) Also tests : ruff, CI's mypy run, test_backend_pdf.py and test_pyplot_up_to_date pass. AI DisclosureClaude Code ( Claude Opus 5.5 (high) ) assisted me in writing the fix. PR quality check
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
timhoffm
reviewed
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's more complicated than that. fname is passed on to self.canvas.print_figure, and FigureCanvasBase.print_figure does not accept PdfPages either. Mypy doesn't flag this only because, with figure.pyi present, the implementation of Figure.savefig is never type-checked against the stubs. The type system can't reasonably express the current situation, where the types savefig accepts depend on the runtime type of another object (figure.canvas). Adding PdfPages to FigureCanvasBase.print_figure would mean adding it to all canvas subclasses as well: too permissive, cumbersome, and ultimately impractical for third-party backends. T.b.h. I just wouldn't bother with the type imperfection. The backend_pdf.pyi changes themselves seem ok.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so do i drop both commits : fname changes to this figure.pyi as well as pyplot.py ?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
maaz7409
force-pushed
the
typ-fix-install-backend-pdf-stub
branch
from
b19f8ec to
0fa049d
Compare
timhoffm
approved these changes
This branch has not been deployedNo deployments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. |