[Python-checkins] peps: PEP 454: add Snapshot.load() method

victor.stinner python-checkins at python.org
Tue Sep 3 00:41:32 CEST 2013


http://hg.python.org/peps/rev/8575d152ab03
changeset:   5090:8575d152ab03
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Sep 03 00:41:20 2013 +0200
summary:
  PEP 454: add Snapshot.load() method

files:
  pep-0454.txt |  38 ++++++++++++++++++++++----------------
  1 files changed, 22 insertions(+), 16 deletions(-)


diff --git a/pep-0454.txt b/pep-0454.txt
--- a/pep-0454.txt
+++ b/pep-0454.txt
@@ -99,22 +99,22 @@
    Stop the timer started by ``start_timer()``.
 
 
-DisplayTop
-----------
+DisplayTop class
+----------------
 
 DisplayTop(count: int, file=sys.stdout) class:
 
    Display the list of the N biggest memory allocations.
 
-display():
+display() method:
 
       Display the top
 
-start(delay: int):
+start(delay: int) method:
 
       Start a task using tracemalloc timer to display the top every delay seconds.
 
-stop():
+stop() method:
 
       Stop the task started by the ``DisplayTop.start()`` method
 
@@ -154,15 +154,15 @@
       ``None``).  See ``Snapshot.create()``.
 
 
-Snapshot
---------
+Snapshot class
+--------------
 
 Snapshot() class:
 
    Snapshot of Python memory allocations. Use ``TakeSnapshot`` to regulary
    take snapshots.
 
-create(user_data_callback=None)
+create(user_data_callback=None) method:
 
       Take a snapshot. If user_data_callback is specified, it must be a callable
       object returning a list of (title: str, format: str, value: int). format
@@ -171,16 +171,20 @@
 
       Example: ``[('Video memory', 'size', 234902)]``.
 
-filter_filenames(patterns: str|list, include: bool)
+filter_filenames(patterns: str|list, include: bool) method:
 
       Remove filenames not matching any pattern if include is True, or remove
       filenames matching a pattern if include is False (exclude). See
       fnmatch.fnmatch() for the syntax of patterns.
 
-write(filename)
+write(filename) method:
 
       Write the snapshot into a file.
 
+load(filename), classmethod:
+
+      Load a snapshot from a file.
+
 pid attribute:
 
       Identifier of the process which created the snapshot (int).
@@ -194,22 +198,22 @@
       Date and time of the creation of the snapshot (str).
 
 
-TakeSnapshot
-------------
+TakeSnapshot class
+------------------
 
 TakeSnapshot class:
 
    Task taking snapshots of Python memory allocations: write them into files.
 
-start(delay: int)
+start(delay: int) method:
 
       Start a task taking a snapshot every delay seconds.
 
-stop():
+stop() method:
 
       Stop the task started by the ``TakeSnapshot.start()`` method.
 
-take_snapshot():
+take_snapshot() method:
 
       Take a snapshot.
 
@@ -231,7 +235,9 @@
 Links
 =====
 
-* `Python issue #18874: Add a new tracemalloc module to trace Python
+Python issues:
+
+* `#18874: Add a new tracemalloc module to trace Python
   memory allocations <http://bugs.python.org/issue18874>`_
 
 Similar projects:

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list