diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2009-10-23 19:58:17 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2009-10-23 19:58:17 (GMT) |
commit | d87affece4e5c4a963080b942a0517247d7798c2 (patch) | |
tree | b962e30711e8b7a10350407726535debe5046729 /Lib | |
parent | b5cf8a059c24a47e744fa22cd8628425f91908fd (diff) | |
download | cpython-d87affece4e5c4a963080b942a0517247d7798c2.zip cpython-d87affece4e5c4a963080b942a0517247d7798c2.tar.gz cpython-d87affece4e5c4a963080b942a0517247d7798c2.tar.bz2 |
Improve some docstrings in the 'warnings' module.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/warnings.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Lib/warnings.py b/Lib/warnings.py index 14466d3..8d46cd6 100644 --- a/Lib/warnings.py +++ b/Lib/warnings.py @@ -46,7 +46,14 @@ def filterwarnings(action, message="", category=Warning, module="", lineno=0, 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 @@ def simplefilter(action, category=Warning, lineno=0, append=0): """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,) |