[Python-checkins] peps: PEP 454: set_traceback_limit() requires nframe >= 1
victor.stinner
python-checkins at python.org
Sun Nov 10 23:56:48 CET 2013
http://hg.python.org/peps/rev/72fc6b519f12
changeset: 5264:72fc6b519f12
user: Victor Stinner <victor.stinner at gmail.com>
date: Sun Nov 10 23:54:37 2013 +0100
summary:
PEP 454: set_traceback_limit() requires nframe >= 1
files:
pep-0454.txt | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/pep-0454.txt b/pep-0454.txt
--- a/pep-0454.txt
+++ b/pep-0454.txt
@@ -153,6 +153,7 @@
``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 @@
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 @@
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()``
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list