| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| # For clarity, names from _image are given explicitly in this module | ||
| from matplotlib import _image | ||
| # For user convenience, the names from _image are also imported into | ||
| # the image namespace |
There was a problem hiding this comment.
One can actually question this comment. At least, assuming that the whole idea of putting things into _image was to make these functions and classes "private".
Sorry, something went wrong.
There was a problem hiding this comment.
It's _image because it's a compiled extension, not necessarily to be private.
Sorry, something went wrong.
There was a problem hiding this comment.
_image contains C code (see image_wrapper.cpp). It's a standard but arguably confusing convention to use a leading underscore for C parts of of a python module.
OTOH it's questionable whether we need these wildcard imports. It's just the function resample() plus a number of constants. We don't uses these in image.py (only via the qualified _image.*). Users could use resample(), but it's rather low-level. The only use for the constants is as parameters to resample. The high-level image interface uses string versions of the constants instead.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the clarification!
I double-checked that nothing is imported from _image through image in the code base and unless I failed or there were some missing dependency not triggering the code, it should at least be OK from that perspective.
But probably safest to keep it as is for now.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
is typically better (shorter) written as
Note that some of the existing ones are changed in #22148 so these should be (most) of the remaining ones.
PR Checklist
Tests and Styling
Documentation