Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(5)

Side by Side Diff: Doc/library/importlib.rst

Issue 18758: Fix internal references in the documentation
Patch Set: Created 6 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/imaplib.rst ('k') | Doc/library/inspect.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`importlib` -- An implementation of :keyword:`import` 1 :mod:`importlib` -- An implementation of :keyword:`import`
2 ========================================================== 2 ==========================================================
3 3
4 .. module:: importlib 4 .. module:: importlib
5 :synopsis: An implementation of the import machinery. 5 :synopsis: An implementation of the import machinery.
6 6
7 .. moduleauthor:: Brett Cannon <brett@python.org> 7 .. moduleauthor:: Brett Cannon <brett@python.org>
8 .. sectionauthor:: Brett Cannon <brett@python.org> 8 .. sectionauthor:: Brett Cannon <brett@python.org>
9 9
10 .. versionadded:: 3.1 10 .. versionadded:: 3.1
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 statement it can test for the table's presence and skip its initialization if 158 statement it can test for the table's presence and skip its initialization if
159 desired:: 159 desired::
160 160
161 try: 161 try:
162 cache 162 cache
163 except NameError: 163 except NameError:
164 cache = {} 164 cache = {}
165 165
166 It is legal though generally not very useful to reload built-in or 166 It is legal though generally not very useful to reload built-in or
167 dynamically loaded modules (this is not true for e.g. :mod:`sys`, 167 dynamically loaded modules (this is not true for e.g. :mod:`sys`,
168 :mod:`__main__`, :mod:`__builtin__` and other key modules where reloading is 168 :mod:`__main__`, :mod:`builtins` and other key modules where reloading is
169 frowned upon). In many cases, however, extension modules are not designed to 169 frowned upon). In many cases, however, extension modules are not designed to
170 be initialized more than once, and may fail in arbitrary ways when reloaded. 170 be initialized more than once, and may fail in arbitrary ways when reloaded.
171 171
172 If a module imports objects from another module using :keyword:`from` ... 172 If a module imports objects from another module using :keyword:`from` ...
173 :keyword:`import` ..., calling :func:`reload` for the other module does not 173 :keyword:`import` ..., calling :func:`reload` for the other module does not
174 redefine the objects imported from it --- one way around this is to 174 redefine the objects imported from it --- one way around this is to
175 re-execute the :keyword:`from` statement, another is to use :keyword:`import` 175 re-execute the :keyword:`from` statement, another is to use :keyword:`import`
176 and qualified names (*module.name*) instead. 176 and qualified names (*module.name*) instead.
177 177
178 If a module instantiates instances of a class, reloading the module that 178 If a module instantiates instances of a class, reloading the module that
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 1018
1019 .. decorator:: set_package 1019 .. decorator:: set_package
1020 1020
1021 A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the : attr:`__package__` attribute on the returned module. If :attr:`__package__` 1021 A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the : attr:`__package__` attribute on the returned module. If :attr:`__package__`
1022 is set and has a value other than ``None`` it will not be changed. 1022 is set and has a value other than ``None`` it will not be changed.
1023 1023
1024 .. note:: 1024 .. note::
1025 As this decorator sets :attr:`__package__` after loading the module, it is 1025 As this decorator sets :attr:`__package__` after loading the module, it is
1026 recommended to use :meth:`importlib.abc.Loader.init_module_attrs` instead 1026 recommended to use :meth:`importlib.abc.Loader.init_module_attrs` instead
1027 when appropriate. 1027 when appropriate.
OLDNEW
« no previous file with comments | « Doc/library/imaplib.rst ('k') | Doc/library/inspect.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+