[Python-checkins] r62995 - python/trunk/Doc/library/warnings.rst

andrew.kuchling python-checkins at python.org
Sat May 10 19:37:05 CEST 2008


Author: andrew.kuchling
Date: Sat May 10 19:37:05 2008
New Revision: 62995

Log:
Document the 'line' argument

Modified:
   python/trunk/Doc/library/warnings.rst

Modified: python/trunk/Doc/library/warnings.rst
==============================================================================
--- python/trunk/Doc/library/warnings.rst	(original)
+++ python/trunk/Doc/library/warnings.rst	Sat May 10 19:37:05 2008
@@ -218,6 +218,9 @@
    resulting string to *file*, which defaults to ``sys.stderr``.  You may replace
    this function with an alternative implementation by assigning to
    ``warnings.showwarning``.
+   *line* is a line of source code to be included in the warning
+   message; if *line* is not supplied, :func:`showwarning` will 
+   try to read the line specified by *filename* and *lineno*.
 
    .. versionchanged:: 2.6
       Added the *line* argument. Implementations that lack the new argument
@@ -227,7 +230,9 @@
 .. function:: formatwarning(message, category, filename, lineno[, line])
 
    Format a warning the standard way.  This returns a string  which may contain
-   embedded newlines and ends in a newline.
+   embedded newlines and ends in a newline.  *line* is 
+   a line of source code to be included in the warning message; if *line* is not supplied, 
+   :func:`formatwarning` will try to read the line specified by *filename* and *lineno*.
 
    .. versionchanged:: 2.6
       Added the *line* argument.


More information about the Python-checkins mailing list