February 2006
Intermediate to advanced
648 pages
14h 53m
English
The warnings module provides functions to issue and filter warning messages. Unlike exceptions, warnings are intended to alert the user to potential problems, but without generating an exception or causing execution to stop. One of the primary uses of the warnings module is to inform users about deprecated language features that may not be supported in future versions of Python. For example:
>>> import regex
__main__:1: DeprecationWarning: the regex module is deprecated; use the re module
>>>Like exceptions, warnings are organized into a class hierarchy that describes general categories of warnings. The following table lists the currently supported categories:
| Column1 | Column2 |
|---|---|
| Warning | Base class of all warning types |
| UserWarning | User-defined ... |
Read now
Unlock full access