Issue #20769: Improve reload() docs. Patch by Dorian Pula.

This commit is contained in:
Robert Collins 2015-08-05 08:20:53 +12:00
parent 2a8911c0b7
commit 1ae28d2ff3
3 changed files with 8 additions and 5 deletions

View file

@ -166,11 +166,11 @@ Functions
except NameError:
cache = {}
It is legal though generally not very useful to reload built-in or
dynamically loaded modules (this is not true for e.g. :mod:`sys`,
:mod:`__main__`, :mod:`builtins` and other key modules where reloading is
frowned upon). In many cases, however, extension modules are not designed to
be initialized more than once, and may fail in arbitrary ways when reloaded.
It is generally not very useful to reload built-in or dynamically loaded
modules. Reloading :mod:`sys`, :mod:`__main__`, :mod:`builtins` and other
key modules is not recommended. In many cases extension modules are not
designed to be initialized more than once, and may fail in arbitrary ways
when reloaded.
If a module imports objects from another module using :keyword:`from` ...
:keyword:`import` ..., calling :func:`reload` for the other module does not