summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-04-12 23:44:07 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-04-12 23:44:07 (GMT)
commite9746890388178bb1e4cdad3c0586bf1862c3727 (patch)
tree77e228e19ac5673aac13dac8292281fc9a3010ab /Doc/library
parente6c03033afc58804cfdb143bef67e9cd37e25507 (diff)
downloadcpython-e9746890388178bb1e4cdad3c0586bf1862c3727.zip
cpython-e9746890388178bb1e4cdad3c0586bf1862c3727.tar.gz
cpython-e9746890388178bb1e4cdad3c0586bf1862c3727.tar.bz2
Re-implement the 'warnings' module in C. This allows for usage of the
'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/warnings.rst18
1 files changed, 13 insertions, 5 deletions
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index d2e5b68..2267a0d 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -211,20 +211,28 @@ Available Functions
is using :exc:`DeprecationWarning` as default warning class.
-.. function:: showwarning(message, category, filename, lineno[, file])
+.. function:: showwarning(message, category, filename, lineno[, file[, line]])
Write a warning to a file. The default implementation calls
- ``formatwarning(message, category, filename, lineno)`` and writes the resulting
- string to *file*, which defaults to ``sys.stderr``. You may replace this
- function with an alternative implementation by assigning to
+ ``formatwarning(message, category, filename, lineno, line)`` and writes the
+ resulting string to *file*, which defaults to ``sys.stderr``. You may replace
+ this function with an alternative implementation by assigning to
``warnings.showwarning``.
+ ..versionchanged:: 2.6
+ Added the `line` argument.
-.. function:: formatwarning(message, category, filename, lineno)
+
+
+
+.. 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.
+ ..versionchanged:: 2.6
+ Added the `line` argument.
+
.. function:: filterwarnings(action[, message[, category[, module[, lineno[, append]]]]])