]> granicus.if.org Git - python/commitdiff
Document the 'line' argument
authorAndrew M. Kuchling <amk@amk.ca>
Sat, 10 May 2008 17:37:05 +0000 (17:37 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Sat, 10 May 2008 17:37:05 +0000 (17:37 +0000)
Doc/library/warnings.rst

index 87c4fd6c0035a85b840c32534a71915e003b2849..888cb84ef047f9dcc74ee1928f426e8b7b1dd691 100644 (file)
@@ -218,6 +218,9 @@ Available Functions
    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 @@ Available Functions
 .. 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.