changeset: 102673:86d062edb6ab user: Nick Coghlan date: Tue Aug 16 10:58:14 2016 +1000 files: Doc/library/traceback.rst Doc/whatsnew/3.6.rst description: Issue #26823: fix traceback abbreviation docs - be clear builtin traceback display was also updated - show example output in What's New - fix versionadded markup diff -r 705416c5909e -r 86d062edb6ab Doc/library/traceback.rst --- a/Doc/library/traceback.rst Mon Aug 15 15:08:11 2016 -0700 +++ b/Doc/library/traceback.rst Tue Aug 16 10:58:14 2016 +1000 @@ -302,9 +302,8 @@ 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 diff -r 705416c5909e -r 86d062edb6ab Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst Mon Aug 15 15:08:11 2016 -0700 +++ b/Doc/whatsnew/3.6.rst Tue Aug 16 10:58:14 2016 +1000 @@ -207,7 +207,12 @@ 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 @@ (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 "", line 1, in + File "", line 1, in f + File "", line 1, in f + File "", line 1, in f + [Previous line repeated 995 more times] + RecursionError: maximum recursion depth exceeded + (Contributed by Emanuel Barry in :issue:`26823`.)