[Python-checkins] peps: PEP 454: rename filter() to add_filter(); update the PEP to the last
victor.stinner
python-checkins at python.org
Sun Sep 8 15:58:13 CEST 2013
http://hg.python.org/peps/rev/e39c05e32466
changeset: 5103:e39c05e32466
user: Victor Stinner <victor.stinner at gmail.com>
date: Sun Sep 08 15:58:01 2013 +0200
summary:
PEP 454: rename filter() to add_filter(); update the PEP to the last implementation
files:
pep-0454.txt | 40 +++++++++++++++++++++++++++-------------
1 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/pep-0454.txt b/pep-0454.txt
--- a/pep-0454.txt
+++ b/pep-0454.txt
@@ -84,6 +84,21 @@
Functions
---------
+``add_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. The
+ ``.pyc`` and ``.pyo`` suffixes are automatically replaced with
+ ``.py`` when matching the filename.
+
+ *lineno* is a line number. If *lineno* is ``None`` or lesser than
+ ``1``, it matches any line number.
+
``clear_filters()`` function:
Reset the filter list.
@@ -101,19 +116,6 @@
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
@@ -121,6 +123,9 @@
If *lineno* is ``None``, a filter matchs any line number.
+ By default, the filename of the Python tracemalloc module
+ (``tracemalloc.py``) is excluded.
+
``get_number_frame()`` function:
Get the maximum number of frames stored in a trace of a memory
@@ -162,6 +167,10 @@
Return an empty dictionary if the tracemalloc module is disabled.
+``get_tracemalloc_size()`` function:
+
+ Get the memory usage in bytes of the ``tracemalloc`` module.
+
``get_traces(obj)`` function:
Get all traces of a Python memory allocations.
@@ -365,6 +374,11 @@
Result of the ``get_stats()`` function.
+``tracemalloc_size`` attribute (``int``):
+
+ The memory usage in bytes of the ``tracemalloc`` module,
+ result of the ``get_tracemalloc_size()`` function.
+
``timestamp`` attribute (``datetime.datetime``):
Creation date and time of the snapshot.
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list