diff options
author | Brett Cannon <brett@python.org> | 2014-01-07 20:52:42 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2014-01-07 20:52:42 (GMT) |
commit | 8d942296bb6cc45e519447484084bee1507d664b (patch) | |
tree | c546f6f8819af7d96b61ba331b0f7cf479a4ea48 /Doc | |
parent | 61272b77b0792318105bbdb6887a029b6a1743da (diff) | |
download | cpython-8d942296bb6cc45e519447484084bee1507d664b.zip cpython-8d942296bb6cc45e519447484084bee1507d664b.tar.gz cpython-8d942296bb6cc45e519447484084bee1507d664b.tar.bz2 |
Issue #19719: Update various finder and loader ABCs such that their
old methods now provide implementations when PEP 451 APIs are present.
This should help with backwards-compatibility with code which has not
been updated to work with PEP 451.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/importlib.rst | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index 82d6d6d..dc29b8a 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -275,9 +275,13 @@ ABC hierarchy:: will be the value of :attr:`__path__` from the parent package. If a loader cannot be found, ``None`` is returned. + If :meth:`find_spec` is defined, backwards-compatible functionality is + provided. + .. versionchanged:: 3.4 Returns ``None`` when called instead of raising - :exc:`NotImplementedError`. + :exc:`NotImplementedError`. Can use :meth:`find_spec` to provide + functionality. .. deprecated:: 3.4 Use :meth:`find_spec` instead. @@ -325,8 +329,12 @@ ABC hierarchy:: ``portion`` is the empty list then no loader or location for a namespace package were found (i.e. failure to find anything for the module). + If :meth:`find_spec` is defined then backwards-compatible functionality is + provided. + .. versionchanged:: 3.4 Returns ``(None, [])`` instead of raising :exc:`NotImplementedError`. + Uses :meth:`find_spec` when available to provide functionality. .. deprecated:: 3.4 Use :meth:`find_spec` instead. @@ -413,9 +421,13 @@ ABC hierarchy:: :func:`importlib.util.module_for_loader` decorator can handle the details for :attr:`__package__`. + When :meth:`exec_module` is available then backwards-compatible + functionality is provided. + .. versionchanged:: 3.4 Raise :exc:`ImportError` when called instead of - :exc:`NotImplementedError`. + :exc:`NotImplementedError`. Functionality provided when + :meth:`exec_module` is available. .. deprecated:: 3.4 The recommended API for loading a module is :meth:`exec_module` |