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

Skip to content

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