summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-03-06 17:06:41 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-03-06 17:06:41 +0100
commit9347a6431a684574291159654fbd5eeaff01ffec (patch)
tree91f560f8b0b35a5551844bcd71cbbde8a04718a5 /Lib
parentd1912c14177f4a431417bcaa6fd8b3efdaac9716 (diff)
downloadcpython-9347a6431a684574291159654fbd5eeaff01ffec.tar.gz
tracemalloc.py: add comments to show the format of tuples
Diffstat (limited to 'Lib')
-rw-r--r--Lib/tracemalloc.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/tracemalloc.py b/Lib/tracemalloc.py
index dd73d053b4..f117127339 100644
--- a/Lib/tracemalloc.py
+++ b/Lib/tracemalloc.py
@@ -141,6 +141,7 @@ class Frame:
__slots__ = ("_frame",)
def __init__(self, frame):
+ # frame is a tuple: (filename: str, lineno: int)
self._frame = frame
@property
@@ -177,6 +178,8 @@ class Traceback(Sequence):
def __init__(self, frames):
Sequence.__init__(self)
+ # frames is a tuple of frame tuples: see Frame constructor for the
+ # format of a frame tuple
self._frames = frames
def __len__(self):
@@ -241,6 +244,8 @@ class Trace:
__slots__ = ("_trace",)
def __init__(self, trace):
+ # trace is a tuple: (size, traceback), see Traceback constructor
+ # for the format of the traceback tuple
self._trace = trace
@property
@@ -268,6 +273,7 @@ class Trace:
class _Traces(Sequence):
def __init__(self, traces):
Sequence.__init__(self)
+ # traces is a tuple of trace tuples: see Trace constructor
self._traces = traces
def __len__(self):
@@ -338,6 +344,8 @@ class Snapshot:
"""
def __init__(self, traces, traceback_limit):
+ # traces is a tuple of trace tuples: see _Traces constructor for
+ # the exact format
self.traces = _Traces(traces)
self.traceback_limit = traceback_limit