diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2014-08-24 14:50:28 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2014-08-24 14:50:28 (GMT) |
commit | cdcafb78b22ec1cc677abbb2ce292db79279e221 (patch) | |
tree | ccf586cfa575fb1f8c67edb6a3ed7ea757bd4a8a /Doc/library/inspect.rst | |
parent | 1fa36268cfdac3760de37859aa3ec1b5121248c5 (diff) | |
download | cpython-cdcafb78b22ec1cc677abbb2ce292db79279e221.zip cpython-cdcafb78b22ec1cc677abbb2ce292db79279e221.tar.gz cpython-cdcafb78b22ec1cc677abbb2ce292db79279e221.tar.bz2 |
Issue #16808: inspect.stack() now returns a named tuple instead of a tuple.
Patch by Daniel Shahaf.
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r-- | Doc/library/inspect.rst | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst index 359f833..2e209eb 100644 --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -881,11 +881,17 @@ Classes and functions The interpreter stack --------------------- -When the following functions return "frame records," each record is a tuple of -six items: the frame object, the filename, the line number of the current line, +When the following functions return "frame records," each record is a +:term:`named tuple` +``FrameInfo(frame, filename, lineno, function, code_context, index)``. +The tuple contains the frame object, the filename, the line number of the +current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. +.. versionchanged:: 3.5 + Return a named tuple instead of a tuple. + .. note:: Keeping references to frame objects, as found in the first element of the frame |