[Python-checkins] cpython: tracemalloc.py: add comments to show the format of tuples

victor.stinner python-checkins at python.org
Thu Mar 6 17:07:03 CET 2014


http://hg.python.org/cpython/rev/b07400659dba
changeset: 89489:b07400659dba
user: Victor Stinner <victor.stinner at gmail.com>
date: Thu Mar 06 17:06:41 2014 +0100
summary:
 tracemalloc.py: add comments to show the format of tuples
files:
 Lib/tracemalloc.py | 8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/Lib/tracemalloc.py b/Lib/tracemalloc.py
--- a/Lib/tracemalloc.py
+++ b/Lib/tracemalloc.py
@@ -141,6 +141,7 @@
 __slots__ = ("_frame",)
 
 def __init__(self, frame):
+ # frame is a tuple: (filename: str, lineno: int)
 self._frame = frame
 
 @property
@@ -177,6 +178,8 @@
 
 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 @@
 __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 _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 @@
 """
 
 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
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /