summaryrefslogtreecommitdiffstats
path: root/Doc/library/inspect.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-08-05 21:26:40 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-08-05 21:26:40 (GMT)
commit58720d6145eca69b9aa45b720cb3c1376b1ddaea (patch)
tree56a90729aff1127491b8f895b40b4159ca3dce56 /Doc/library/inspect.rst
parentc53204b9477a2e28b6b366fd271f61c73b805cee (diff)
downloadcpython-58720d6145eca69b9aa45b720cb3c1376b1ddaea.zip
cpython-58720d6145eca69b9aa45b720cb3c1376b1ddaea.tar.gz
cpython-58720d6145eca69b9aa45b720cb3c1376b1ddaea.tar.bz2
Issue #17934: Add a clear() method to frame objects, to help clean up expensive details (local variables) and break reference cycles.
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r--Doc/library/inspect.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index af6c96b..9f784fd 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -846,6 +846,10 @@ index of the current line within that list.
finally:
del frame
+ If you want to keep the frame around (for example to print a traceback
+ later), you can also break reference cycles by using the
+ :meth:`frame.clear` method.
+
The optional *context* argument supported by most of these functions specifies
the number of lines of context to return, which are centered around the current
line.