[Python-checkins] r75640 - python/trunk/Lib/warnings.py

neil.schemenauer python-checkins at python.org
Fri Oct 23 21:58:18 CEST 2009


Author: neil.schemenauer
Date: Fri Oct 23 21:58:17 2009
New Revision: 75640

Log:
Improve some docstrings in the 'warnings' module.


Modified:
   python/trunk/Lib/warnings.py

Modified: python/trunk/Lib/warnings.py
==============================================================================
--- python/trunk/Lib/warnings.py	(original)
+++ python/trunk/Lib/warnings.py	Fri Oct 23 21:58:17 2009
@@ -46,7 +46,14 @@
                    append=0):
     """Insert an entry into the list of warnings filters (at the front).
 
-    Use assertions to check that all arguments have the right type."""
+    'action' -- one of "error", "ignore", "always", "default", "module",
+                or "once"
+    'message' -- a regex that the warning message must match
+    'category' -- a class that the warning must be a subclass of
+    'module' -- a regex that the module name must match
+    'lineno' -- an integer line number, 0 matches all warnings
+    'append' -- if true, append to the list of filters
+    """
     import re
     assert action in ("error", "ignore", "always", "default", "module",
                       "once"), "invalid action: %r" % (action,)
@@ -68,6 +75,11 @@
     """Insert a simple entry into the list of warnings filters (at the front).
 
     A simple filter matches all modules and messages.
+    'action' -- one of "error", "ignore", "always", "default", "module",
+                or "once"
+    'category' -- a class that the warning must be a subclass of
+    'lineno' -- an integer line number, 0 matches all warnings
+    'append' -- if true, append to the list of filters
     """
     assert action in ("error", "ignore", "always", "default", "module",
                       "once"), "invalid action: %r" % (action,)


More information about the Python-checkins mailing list