From a02a8d4d388df2dd2300a3711ae34e1e4c79ef1d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:53:33 +0300 Subject: [PATCH 1/3] Formatting --- peps/pep-0830.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/peps/pep-0830.rst b/peps/pep-0830.rst index 0eab55800f6..b8e538821cf 100644 --- a/peps/pep-0830.rst +++ b/peps/pep-0830.rst @@ -144,7 +144,7 @@ Display Format Timestamps are appended to the exception message line in tracebacks using the format ``<@timestamp>``. Example with ``iso``: -.. code-block:: text +.. code-block:: pytb Traceback (most recent call last): File "", line 3, in california_raisin @@ -219,7 +219,7 @@ demonstrates the importance of that optimization. I used ``configure --enable-optimizations`` builds for my benchmarks and ran them using commands such as: -.. code-block:: text +.. code-block:: shell pyperformance run -p baseline-3a7df632c96/build/python -o baseline-eopt.json pyperformance run -p traceback-timestamps/build/python -o traceback-timestamps-default-eopt.json @@ -250,30 +250,30 @@ Pickled Exception Examples With traceback timestamp collection enabled: -.. code-block:: text +.. code-block:: console - ❯ build/python -X traceback_timestamps=iso -c 'import pickle; print(pickle.dumps(RuntimeError("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' + $ build/python -X traceback_timestamps=iso -c 'import pickle; print(pickle.dumps(RuntimeError("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' b'\x80\x05\x95L\x00\x00\x00\x00\x00\x00\x00\x8c\x08builtins\x94\x8c\x0cRuntimeError\x94\x93\x94\x8c\x07pep-830\x94\x85\x94R\x94}\x94\x8c\x10__timestamp_ns__\x94\x8a\x08\xf4\xd8\x94`\x15\xaf\xa5\x18sb.' The special case for ``StopIteration`` means it does not carry the dict with timestamp data: -.. code-block:: text +.. code-block:: console - ❯ build/python -X traceback_timestamps=iso -c 'import pickle; print(pickle.dumps(StopIteration("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' + $ build/python -X traceback_timestamps=iso -c 'import pickle; print(pickle.dumps(StopIteration("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' b'\x80\x05\x95,\x00\x00\x00\x00\x00\x00\x00\x8c\x08builtins\x94\x8c\rStopIteration\x94\x93\x94\x8c\x07pep-830\x94\x85\x94R\x94.' Nor do exceptions carry the timestamp when the feature is disabled (the default): -.. code-block:: text +.. code-block:: console - ❯ build/python -X traceback_timestamps=0 -c 'import pickle; print(pickle.dumps(RuntimeError("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' + $ build/python -X traceback_timestamps=0 -c 'import pickle; print(pickle.dumps(RuntimeError("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' b'\x80\x05\x95+\x00\x00\x00\x00\x00\x00\x00\x8c\x08builtins\x94\x8c\x0cRuntimeError\x94\x93\x94\x8c\x07pep-830\x94\x85\x94R\x94.' Which matches what Python 3.13 produces: -.. code-block:: text +.. code-block:: console - ❯ python3.13 -c 'import pickle; print(pickle.dumps(RuntimeError("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' + $ python3.13 -c 'import pickle; print(pickle.dumps(RuntimeError("pep-830"), protocol=pickle.HIGHEST_PROTOCOL))' b'\x80\x05\x95+\x00\x00\x00\x00\x00\x00\x00\x8c\x08builtins\x94\x8c\x0cRuntimeError\x94\x93\x94\x8c\x07pep-830\x94\x85\x94R\x94.' Maintenance Burden From c2720fe34c95bc08f2497fbb680b29162d8c022d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:53:43 +0300 Subject: [PATCH 2/3] Typo --- peps/pep-0830.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0830.rst b/peps/pep-0830.rst index b8e538821cf..6cd6127dd4b 100644 --- a/peps/pep-0830.rst +++ b/peps/pep-0830.rst @@ -208,7 +208,7 @@ occasional varying 1-2% measurement noise that could not be reliably reproduced. Below the benchmarking setup noise threshold as far as the author is concerned. -What about the special case performance optimiaztion? If I omit the two line +What about the special case performance optimization? If I omit the two-line special case to avoid collecting timestamps on ``StopIteration`` and ``StopAsyncIteration`` in ``Objects/exception.c``, only a single benchmark showed a regression: ``async_generators``. That one would reliably run on the From 86102f985c486aa8e121b068fa7992e2770a9265 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:53:54 +0300 Subject: [PATCH 3/3] dcolascione -> +Daniel Colascione --- peps/pep-0830.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peps/pep-0830.rst b/peps/pep-0830.rst index 6cd6127dd4b..67c3d8f5227 100644 --- a/peps/pep-0830.rst +++ b/peps/pep-0830.rst @@ -397,7 +397,7 @@ Acknowledgements ================ Thanks to Nathaniel J. Smith for the original idea suggestion, and to -``@dcolascione`` for initial 2025 review feedback on the implementation. +Daniel Colascione for initial 2025 review feedback on the implementation. Change History