[Python-checkins] peps: PEP 454: add clear_filters(), filter() and get_filters() functions

victor.stinner python-checkins at python.org
Sun Sep 8 15:15:40 CEST 2013


http://hg.python.org/peps/rev/47234db47d7b
changeset:   5102:47234db47d7b
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sun Sep 08 15:15:26 2013 +0200
summary:
  PEP 454: add clear_filters(), filter() and get_filters() functions

files:
  pep-0454.txt |  24 ++++++++++++++++++++++++
  1 files changed, 24 insertions(+), 0 deletions(-)


diff --git a/pep-0454.txt b/pep-0454.txt
--- a/pep-0454.txt
+++ b/pep-0454.txt
@@ -84,6 +84,10 @@
 Functions
 ---------
 
+``clear_filters()`` function:
+
+    Reset the filter list.
+
 ``clear_traces()`` function:
 
     Clear all traces and statistics of memory allocations.
@@ -97,6 +101,26 @@
 
     Start tracing Python memory allocations.
 
+``filter(include: bool, filename: str, lineno: int=None)`` function:
+
+    Add a filter. If *include* is ``True``, only trace memory blocks
+    allocated in a file with a name matching *filename*. If
+    *include* is ``False``, don't trace memory blocks allocated in a
+    file with a name matching *filename*.
+
+    The match is done using *filename* as a prefix. For example,
+    ``'/usr/bin/'`` only matchs files the ``/usr/bin`` directories.
+
+    *lineno* is a line number. If *lineno* is ``None`` or lesser than
+    ``1``, it matches any line number.
+
+``get_filters()`` function:
+
+    Get the filters as list of
+    ``(include: bool, filename: str, lineno: int)`` tuples.
+
+    If *lineno* is ``None``, a filter matchs any line number.
+
 ``get_number_frame()`` function:
 
     Get the maximum number of frames stored in a trace of a memory

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


More information about the Python-checkins mailing list