-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Document what are resources in importlib.resources #88330
New issue
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
Comments
It would be good to explain what constitutes a resource in the importlib.resources documentation. As per the current implementation, they should be defined as arbitrary files contained in the package. Is this correct? |
I've not previously seen a definition of resources. The original implementation of importlib_resources excluded 'directories' as resources and excluded support for resources being in subdirectories (only files in packages were allowed). Now resources can be found in subdirectories that are not packages and in namesepace packages. I'd describe resources thus: "Resources" are file-like resources associated with a module[1] or package in Python. The resources may be contained directly in a package or within a subdirectory contained in that package. Resources may be text or binary. As a result, Python module sources (.py) of a package and compilation artifacts (pycache) are technically de-facto resources of that package. In practice, however, resources are primarily those non-Python artifacts exposed specifically by the package author. [1] Resources associated with top-level modules are not yet supported by importlib[._]resources (python/importlib_resources#203) but were supported by pkg_resources. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: