Skip to content

Commit ccdb58c

Browse files
committed
Document caution regarding use of importlib.reload in production code
1 parent a126893 commit ccdb58c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Doc/faq/programming.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,6 +2218,10 @@ changed module, do this::
22182218
import modname
22192219
importlib.reload(modname)
22202220

2221+
Note that :func:`importlib.reload` was originally designed for use in
2222+
development and debugging, not for use in production code. Reloading modules
2223+
in a running program is tricky and error-prone.
2224+
22212225
Warning: this technique is not 100% fool-proof. In particular, modules
22222226
containing statements like ::
22232227

0 commit comments

Comments
 (0)