Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4f422e34
Commit
4f422e34
authored
Jun 14, 2013
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #17177: Update the programming FAQ to use importlib
parent
82b3d6ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Doc/faq/programming.rst
Doc/faq/programming.rst
+5
-5
No files found.
Doc/faq/programming.rst
View file @
4f422e34
...
...
@@ -1738,12 +1738,12 @@ When I edit an imported module and reimport it, the changes don't show up. Why
For reasons of efficiency as well as consistency, Python only reads the module
file on the first time a module is imported. If it didn't, in a program
consisting of many modules where each one imports the same basic module, the
basic module would be parsed and re-parsed many times. To force rereading of a
basic module would be parsed and re-parsed many times. To force re
-
reading of a
changed module, do this::
import imp
import imp
ortlib
import modname
imp.reload(modname)
imp
ortlib
.reload(modname)
Warning: this technique is not 100% fool-proof. In particular, modules
containing statements like ::
...
...
@@ -1755,10 +1755,10 @@ module contains class definitions, existing class instances will *not* be
updated to use the new class definition. This can result in the following
paradoxical behaviour:
>>> import imp
>>> import imp
ortlib
>>> import cls
>>> c = cls.C() # Create an instance of C
>>> imp.reload(cls)
>>> imp
ortlib
.reload(cls)
<module 'cls' from 'cls.py'>
>>> isinstance(c, cls.C) # isinstance is false?!?
False
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment