]> granicus.if.org Git - python/commitdiff
Issue #26823: fix traceback abbreviation docs
authorNick Coghlan <ncoghlan@gmail.com>
Tue, 16 Aug 2016 00:58:14 +0000 (10:58 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Tue, 16 Aug 2016 00:58:14 +0000 (10:58 +1000)
- be clear builtin traceback display was also updated
- show example output in What's New
- fix versionadded markup

Doc/library/traceback.rst
Doc/whatsnew/3.6.rst

index 533629458f1b3f0494b9f2b5c11122040d1eec21..066ee96fc004abf3b92d01cfd35e69ceb460b9eb 100644 (file)
@@ -302,9 +302,8 @@ capture data for later printing in a lightweight fashion.
       repetitions are shown, followed by a summary line stating the exact
       number of further repetitions.
 
-    .. versionchanged:: 3.6
-
-    Long sequences of repeated frames are now abbreviated.
+      .. versionchanged:: 3.6
+         Long sequences of repeated frames are now abbreviated.
 
 
 :class:`FrameSummary` Objects
index 9050abccc7e7181be690a1719ae353e90f833be4..49e8ed890d794e00089f2157f75b35c7fa903e6a 100644 (file)
@@ -207,7 +207,12 @@ Example of fatal error on buffer overflow using
 Other Language Changes
 ======================
 
-* None yet.
+Some smaller changes made to the core Python language are:
+
+* Long sequences of repeated traceback lines are now abbreviated as
+  ``"[Previous line repeated {count} more times]"`` (see
+  :ref:`py36-traceback` for an example).
+  (Contributed by Emanuel Barry in :issue:`26823`.)
 
 
 New Modules
@@ -438,11 +443,26 @@ not work in future versions of Tcl.
 (Contributed by Serhiy Storchaka in :issue:`22115`).
 
 
+.. _py36-traceback:
+
 traceback
 ---------
 
-The :meth:`~traceback.StackSummary.format` method now abbreviates long sequences
-of repeated lines as ``"[Previous line repeated {count} more times]"``.
+Both the traceback module and the interpreter's builtin exception display now
+abbreviate long sequences of repeated lines in tracebacks as shown in the
+following example::
+
+    >>> def f(): f()
+    ...
+    >>> f()
+    Traceback (most recent call last):
+      File "<stdin>", line 1, in <module>
+      File "<stdin>", line 1, in f
+      File "<stdin>", line 1, in f
+      File "<stdin>", line 1, in f
+      [Previous line repeated 995 more times]
+    RecursionError: maximum recursion depth exceeded
+
 (Contributed by Emanuel Barry in :issue:`26823`.)