8000 Add stub for _image by oscargus · Pull Request #30058 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Add stub for _image #30058

New issue 8000

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

Closed
wants to merge 1 commit into from
Closed

Add stub for _image #30058

wants to merge 1 commit into from

Conversation

oscargus
Copy link
Member
@oscargus oscargus commented May 16, 2025

PR summary

In #30054 there are mypy errors since this private module is not typed and the tests access it directly. I guess there is no harm to have typing here?

Just used mypy stubgen to generate one.

Edit: turns out that stubgen sorts the members in alphabetical order which lead to different enum numbering in the stubfile and the built class, so removed those from the class.

Edit 2: that wasn't it. No idea how to get this (apart from manually order them(?), but that seems brittle...)

PR checklist

@QuLogic
Copy link
Member
QuLogic commented May 17, 2025

You would also need to update lib/matplotlib/image.pyi which has another copy of those stubs, and change it to re-export them from the private one. stubtest is not currently complaining about the new ones here, but the old ones.

@oscargus
Copy link
Member Author

As the problem I was trying to solve is solved in a better way to import the relevant things from image instead of _image this doesn't really contribute anything at the moment so will close it.

@oscargus oscargus closed this May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0