diff options
author | Brett Cannon <bcannon@gmail.com> | 2009-03-10 05:17:37 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2009-03-10 05:17:37 (GMT) |
commit | 2cf03a820483babd243a48de47865585fa697235 (patch) | |
tree | 8f568016f9c3bdc2c6be744ce65057b48c100e91 /Doc | |
parent | d43b30b046ea151612494ed6d44aed3df71b480a (diff) | |
download | cpython-2cf03a820483babd243a48de47865585fa697235.zip cpython-2cf03a820483babd243a48de47865585fa697235.tar.gz cpython-2cf03a820483babd243a48de47865585fa697235.tar.bz2 |
Implement importlib.util.set_loader: a decorator to automatically set
__loader__ on modules.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/importlib.rst | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Doc/library/importlib.rst b/Doc/library/importlib.rst index c1874f6..4610b57 100644 --- a/Doc/library/importlib.rst +++ b/Doc/library/importlib.rst @@ -348,7 +348,15 @@ an :term:`importer`. loader should initialize as specified by :pep:`302`. -.. function:: set_package(method) +.. function:: set_loader(fxn) + + A :term:`decorator` for a :term:`loader` to set the :attr:`__loader__` + attribute on loaded modules. If the attribute is already set the decorator + does nothing. It is assumed that the first positional argument to the + wrapped method is what :attr:`__loader__` should be set to. + + +.. function:: set_package(fxn) A :term:`decorator` for a :term:`loader` to set the :attr:`__package__` attribute on the module returned by the loader. If :attr:`__package__` is |