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
20a8336f
Commit
20a8336f
authored
Mar 21, 2004
by
Skip Montanaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
concrete example of why retaining old objects is good
parent
347c30d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
Doc/lib/libfuncs.tex
Doc/lib/libfuncs.tex
+9
-1
No files found.
Doc/lib/libfuncs.tex
View file @
20a8336f
...
...
@@ -830,7 +830,15 @@ class C(object):
old version, the old definition remains. This feature can be used
to the module's advantage if it maintains a global table or cache of
objects --- with a
\keyword
{
try
}
statement it can test for the
table's presence and skip its initialization if desired.
table's presence and skip its initialization if desired:
\begin{verbatim}
try:
cache
except NameError:
cache =
{}
\end{verbatim}
It is legal though generally not very useful to reload built-in or
dynamically loaded modules, except for
\refmodule
{
sys
}
,
...
...
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