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

Terry Reedy tjreedy at udel.edu
Sun Sep 8 21:16:56 CEST 2013


On 9/8/2013 9:15 AM, victor.stinner wrote:
> 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

'lesser' .> 'less'

> +    ``1``, it matches any line number.

and otherwise (None, > 1)?


> +
> +``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.

This should be moved up to the definition of filter




More information about the Python-checkins mailing list