PEP 454: cleanup

This commit is contained in:
Victor Stinner 2013-10-31 01:23:31 +01:00
parent 0a63f69b11
commit b78d7821b3
1 changed files with 26 additions and 21 deletions

View File

@ -153,6 +153,17 @@ Main functions
See also ``disable()`` and ``enable()`` functions.
``take_snapshot()`` function:
Take a snapshot of traces of memory blocks allocated by Python using
the ``get_traces()`` function. Return a new ``Snapshot`` instance.
The ``tracemalloc`` module must be enabled to take a snapshot, see
the the ``enable()`` function.
See also ``get_traces()`` and ``get_object_traceback()`` functions.
Trace functions
---------------
@ -205,9 +216,17 @@ has a size of 32 bytes and was allocated at ``x.py:7``, line called from line
``tracemalloc`` module was enabled nor memory blocks ignored by
filters (see ``get_filters()``).
The list is not sorted. Take a snapshot using ``take_snapshot()``
and use the ``Snapshot.statistics()`` method to get a sorted list of
statistics.
Tracebacks of traces are limited to ``traceback_limit`` frames. Use
``set_traceback_limit()`` to store more frames.
Return an empty list if the ``tracemalloc`` module is disabled.
See also the ``get_object_traceback()`` function.
See also ``take_snapshot()`` and ``get_object_traceback()``
functions.
``set_traceback_limit(nframe: int)`` function:
@ -226,18 +245,6 @@ has a size of 32 bytes and was allocated at ``x.py:7``, line called from line
limit at startup.
``take_snapshot()`` function:
Take a snapshot of traces of memory blocks allocated by Python.
Tracebacks of traces are limited to ``traceback_limit`` frames. Use
``set_traceback_limit()`` to store more frames.
The ``tracemalloc`` module must be enabled to take a snapshot, see
the the ``enable()`` function.
Filter functions
----------------
@ -334,7 +341,8 @@ Snapshot
``Filter`` instances. Return a new ``Snapshot`` instance with the
filtered traces.
If *filters* is an empty list, just copy the traces.
If *filters* is an empty list, return a new ``Snapshot`` instance
with a copy of the traces.
``dump(filename)`` method:
@ -383,16 +391,13 @@ Snapshot
``traceback_limit`` attribute:
Maximum number of frames stored in the traceback of ``traces``,
result of the ``get_traceback_limit()`` function.
Maximum number of frames stored in the traceback of ``traces``: see
the ``get_traceback_limit()`` function.
``traces`` attribute:
Traces of all memory blocks allocated by Python, result of the
``get_traces()`` function: list of ``(size: int, traceback: tuple)``
tuples, *traceback* is a tuple of ``(filename: str, lineno: int)``
tuples. *size* is the size of the memory block in bytes, *traceback*
is the Python stack where the allocation occured.
Traces of all memory blocks allocated by Python: see the
``get_traces()`` function.
``timestamp`` attribute: