diff options
author | Brett Cannon <brett@python.org> | 2013-05-26 20:45:10 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2013-05-26 20:45:10 (GMT) |
commit | 9ffe85e1e86bc6718f105f2ab9833ef80f691367 (patch) | |
tree | 236b5acf6fa3186bc46d74b64d8f68fc6c5dd097 /Doc/library/importlib.rst | |
parent | 1256f1f438503530d9dcf2790f7ff5b4a08d85f3 (diff) | |
download | cpython-9ffe85e1e86bc6718f105f2ab9833ef80f691367.zip cpython-9ffe85e1e86bc6718f105f2ab9833ef80f691367.tar.gz cpython-9ffe85e1e86bc6718f105f2ab9833ef80f691367.tar.bz2 |
Move importlib.abc.SourceLoader.source_to_code() to InspectLoader.
While the previous location was fine, it makes more sense to have the
method higher up in the inheritance chain, especially at a point where
get_source() is defined which is the earliest source_to_code() could
programmatically be used in the inheritance tree in importlib.abc.
Diffstat (limited to 'Doc/library/importlib.rst')
-rw-r--r-- | Doc/library/importlib.rst | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index c44a345..cf86073 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -349,6 +349,17 @@ ABC hierarchy:: .. versionchanged:: 3.4 Raises :exc:`ImportError` instead of :exc:`NotImplementedError`. + .. method:: source_to_code(data, path='<string>') + + Create a code object from Python source. + + The *data* argument can be whatever the :func:`compile` function + supports (i.e. string or bytes). The *path* argument should be + the "path" to where the source code originated from, which can be an + abstract concept (e.g. location in a zip file). + + .. versionadded:: 3.4 + .. class:: ExecutionLoader @@ -466,17 +477,6 @@ ABC hierarchy:: .. versionchanged:: 3.4 No longer raises :exc:`NotImplementedError` when called. - .. method:: source_to_code(data, path) - - Create a code object from Python source. - - The *data* argument can be whatever the :func:`compile` function - supports (i.e. string or bytes). The *path* argument should be - the "path" to where the source code originated from, which can be an - abstract concept (e.g. location in a zip file). - - .. versionadded:: 3.4 - .. method:: get_code(fullname) Concrete implementation of :meth:`InspectLoader.get_code`. |