diff -r 5a9f2de4dc16 Doc/library/traceback.rst --- a/Doc/library/traceback.rst Sun Jan 03 19:37:07 2016 +0530 +++ b/Doc/library/traceback.rst Fri Jan 08 15:17:18 2016 +0530 @@ -20,9 +20,9 @@ The module defines the following functions: -.. function:: print_tb(traceback, limit=None, file=None) +.. function:: print_tb(tb, limit=None, file=None) - Print up to *limit* stack trace entries from *traceback* (starting from + Print up to *limit* stack trace entries from traceback object *tb* (starting from the caller's frame) if *limit* is positive. Otherwise, print the last ``abs(limit)`` entries. If *limit* is omitted or ``None``, all entries are printed. If *file* is omitted or ``None``, the output goes to @@ -33,16 +33,16 @@ Added negative *limit* support. -.. function:: print_exception(type, value, traceback, limit=None, file=None, chain=True) +.. function:: print_exception(etype, value, tb, limit=None, file=None, chain=True) - Print exception information and stack trace entries from - *traceback* to *file*. This differs from :func:`print_tb` in the following + Print exception information and stack trace entries from traceback object + *tb* to *file*. This differs from :func:`print_tb` in the following ways: - * if *traceback* is not ``None``, it prints a header ``Traceback (most recent + * if *tb* is not ``None``, it prints a header ``Traceback (most recent call last):`` - * it prints the exception *type* and *value* after the stack trace - * if *type* is :exc:`SyntaxError` and *value* has the appropriate format, it + * it prints the exception *etype* and *value* after the stack trace + * if *etype* is :exc:`SyntaxError` and *value* has the appropriate format, it prints the line where the syntax error occurred with a caret indicating the approximate position of the error. @@ -80,10 +80,10 @@ Added negative *limit* support. -.. function:: extract_tb(traceback, limit=None) +.. function:: extract_tb(tb, limit=None) Return a list of "pre-processed" stack trace entries extracted from the - traceback object *traceback*. It is useful for alternate formatting of + traceback object *tb*. It is useful for alternate formatting of stack traces. The optional *limit* argument has the same meaning as for :func:`print_tb`. A "pre-processed" stack trace entry is a 4-tuple (*filename*, *line number*, *function name*, *text*) representing the @@ -99,7 +99,7 @@ arguments have the same meaning as for :func:`print_stack`. -.. function:: format_list(list) +.. function:: format_list(extracted_list) Given a list of tuples as returned by :func:`extract_tb` or :func:`extract_stack`, return a list of strings ready for printing. Each string @@ -108,7 +108,7 @@ newlines as well, for those items whose source text line is not ``None``. -.. function:: format_exception_only(type, value) +.. function:: format_exception_only(etype, value) Format the exception part of a traceback. The arguments are the exception type and value such as given by ``sys.last_type`` and ``sys.last_value``. The return @@ -119,7 +119,7 @@ occurred is the always last string in the list. -.. function:: format_exception(type, value, tb, limit=None, chain=True) +.. function:: format_exception(etype, value, tb, limit=None, chain=True) Format a stack trace and the exception information. The arguments have the same meaning as the corresponding arguments to :func:`print_exception`. The