PEP 454: set_traceback_limit() requires nframe >= 1
This commit is contained in:
parent
fdf301d0d0
commit
596ee26d32
12
pep-0454.txt
12
pep-0454.txt
|
@ -153,6 +153,7 @@ Functions
|
|||
``set_traceback_limit(nframe: int)`` function:
|
||||
|
||||
Set the maximum number of frames stored in the traceback of a trace.
|
||||
*nframe* must be greater or equal to ``1``.
|
||||
|
||||
Storing more frames allocates more memory of the ``tracemalloc``
|
||||
module and makes Python slower. Use the ``get_tracemalloc_memory()``
|
||||
|
@ -163,9 +164,6 @@ Functions
|
|||
grouped by ``'traceback'`` or to compute cumulative statistics: see
|
||||
the ``Snapshot.statistics()`` method.
|
||||
|
||||
If the limit is set to ``0`` frame, a traceback with a frame will be
|
||||
used for all traces: filename ``'<unknown>'`` at line number ``0``.
|
||||
|
||||
Use the ``get_traceback_limit()`` function to get the current limit.
|
||||
|
||||
The ``PYTHONTRACEMALLOC`` environment variable
|
||||
|
@ -456,11 +454,9 @@ Traceback
|
|||
Sequence of ``Frame`` instances sorted from the most recent frame to
|
||||
the oldest frame.
|
||||
|
||||
A traceback contains at least ``1`` frame. If the ``tracemalloc``
|
||||
module failed to get a frame, the filename ``"<unknown>"`` and the
|
||||
line number ``0`` are used. If it failed to get the traceback or if
|
||||
the traceback limit is ``0``, the traceback only contains a frame:
|
||||
filename ``'<unknown>'`` at line number ``0``.
|
||||
A traceback contains at least ``1`` frame. If the ``tracemalloc`` module
|
||||
failed to get a frame, the filename ``"<unknown>"`` at line number ``0`` is
|
||||
used.
|
||||
|
||||
When a snapshot is taken, tracebacks of traces are limited to
|
||||
``get_traceback_limit()`` frames. See the ``take_snapshot()``
|
||||
|
|
Loading…
Reference in New Issue