summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2013-05-28 01:11:04 (GMT)
committerBrett Cannon <brett@python.org>2013-05-28 01:11:04 (GMT)
commit3b62ca88e4217679e4291126162252e75396fb10 (patch)
tree94096b9856c8d1febe27b2031d55132a2f03287c /Doc/library
parentacfa291af9fea3348d4ff2b801efebc14fdd1191 (diff)
downloadcpython-3b62ca88e4217679e4291126162252e75396fb10.zip
cpython-3b62ca88e4217679e4291126162252e75396fb10.tar.gz
cpython-3b62ca88e4217679e4291126162252e75396fb10.tar.bz2
Issue #18072: Implement get_code() for importlib.abc.InspectLoader and
ExecutionLoader.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/importlib.rst12
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst
index cf86073..45fc8ba 100644
--- a/Doc/library/importlib.rst
+++ b/Doc/library/importlib.rst
@@ -318,16 +318,20 @@ ABC hierarchy::
.. method:: get_code(fullname)
- An abstract method to return the :class:`code` object for a module.
- ``None`` is returned if the module does not have a code object
+ Return the code object for a module.
+ ``None`` should be returned if the module does not have a code object
(e.g. built-in module). :exc:`ImportError` is raised if loader cannot
find the requested module.
+ .. note::
+ While the method has a default implementation, it is suggested that
+ it be overridden if possible for performance.
+
.. index::
single: universal newlines; importlib.abc.InspectLoader.get_source method
.. versionchanged:: 3.4
- Raises :exc:`ImportError` instead of :exc:`NotImplementedError`.
+ No longer abstract and a concrete implementation is provided.
.. method:: get_source(fullname)
@@ -410,7 +414,7 @@ ABC hierarchy::
.. method:: get_data(path)
- Returns the open, binary file for *path*.
+ Reads *path* as a binary file and returns the bytes from it.
.. class:: SourceLoader