mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Closes issue #14982: Document that pkgutil's walk_packages() and
iter_modules() requires iter_modules() be defined on an importer. The importers in importlib do not define this non-standard method.
This commit is contained in:
parent
24aa693c7e
commit
47b3239cc6
2 changed files with 12 additions and 0 deletions
|
|
@ -138,6 +138,10 @@ support.
|
|||
|
||||
*prefix* is a string to output on the front of every module name on output.
|
||||
|
||||
.. note::
|
||||
Only works for importers which define a ``iter_modules()`` method, which
|
||||
is non-standard but implemented by classes defined in this module.
|
||||
|
||||
|
||||
.. function:: walk_packages(path=None, prefix='', onerror=None)
|
||||
|
||||
|
|
@ -166,6 +170,10 @@ support.
|
|||
# list all submodules of ctypes
|
||||
walk_packages(ctypes.__path__, ctypes.__name__ + '.')
|
||||
|
||||
.. note::
|
||||
Only works for importers which define a ``iter_modules()`` method, which
|
||||
is non-standard but implemented by classes defined in this module.
|
||||
|
||||
|
||||
.. function:: get_data(package, resource)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue