summaryrefslogtreecommitdiffstats
path: root/Doc/library/warnings.rst
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-05-10 17:37:05 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2008-05-10 17:37:05 (GMT)
commit311c580539328572045974bc50d9904a03a64e79 (patch)
tree1c2eebd3f70a016b8b1f7b2a6b6a311eb885257f /Doc/library/warnings.rst
parent5217d5d6784759eea18b6d49e2fcaa9503fa6b62 (diff)
downloadcpython-311c580539328572045974bc50d9904a03a64e79.zip
cpython-311c580539328572045974bc50d9904a03a64e79.tar.gz
cpython-311c580539328572045974bc50d9904a03a64e79.tar.bz2
Document the 'line' argument
Diffstat (limited to 'Doc/library/warnings.rst')
-rw-r--r--Doc/library/warnings.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index 87c4fd6..888cb84 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -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.