Commit 47b3239c authored by Brett Cannon's avatar Brett Cannon

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.
parent 24aa693c
...@@ -138,6 +138,10 @@ support. ...@@ -138,6 +138,10 @@ support.
*prefix* is a string to output on the front of every module name on output. *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) .. function:: walk_packages(path=None, prefix='', onerror=None)
...@@ -166,6 +170,10 @@ support. ...@@ -166,6 +170,10 @@ support.
# list all submodules of ctypes # list all submodules of ctypes
walk_packages(ctypes.__path__, ctypes.__name__ + '.') 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) .. function:: get_data(package, resource)
......
...@@ -24,6 +24,10 @@ Core and Builtins ...@@ -24,6 +24,10 @@ Core and Builtins
Library Library
------- -------
- Issue #14982: Document that pkgutil's iteration functions require the
non-standard iter_modules() method to be defined by an importer (something
the importlib importers do not define).
- Issue #15036: Allow removing or changing multiple items in - Issue #15036: Allow removing or changing multiple items in
single-file mailboxes (mbox, MMDF, Babyl) flushing the mailbox single-file mailboxes (mbox, MMDF, Babyl) flushing the mailbox
between the changes. between the changes.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment