summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-27 23:16:44 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-27 23:16:44 (GMT)
commit28104c58d2457e2b74245a49e703d020cc2489df (patch)
tree32607b7c0a2319ecff83e9ade5613a37d65a18d7 /Doc
parent715ec1818de43836cffea50d5f4b5e53fc68a849 (diff)
downloadcpython-28104c58d2457e2b74245a49e703d020cc2489df.zip
cpython-28104c58d2457e2b74245a49e703d020cc2489df.tar.gz
cpython-28104c58d2457e2b74245a49e703d020cc2489df.tar.bz2
Expose Py_Py3kWarningFlag as sys.py3kwarning as discussed in #1504
Also added a warning.warnpy3k() as convenient method for Python 3.x related deprecation warnings.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/warnings.rst8
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index 6049f5d..6188195 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -200,6 +200,14 @@ Available Functions
was added in Python 2.5.)
+.. function:: warnpy3k(message[, category[, stacklevel]])
+
+ Issue a warning related to Python 3.x deprecation. Warnings are only shown
+ when Python is started with the -3 option. Like func:`warn` *message* must
+ be a string and *category* a subclass of :exc:`Warning`. :func:`warnpy3k`
+ is using :exc:`DeprecationWarning` as default warning class.
+
+
.. function:: showwarning(message, category, filename, lineno[, file])
Write a warning to a file. The default implementation calls