warnings
– Warn about potential code issues.
This is a slimmed down version of the full CPython module. It defaults to the “always” action instead of “default”, which prints once per occurrence. Only “error” and “ignore” are also supported. No filtering on category is available.
This module implements a subset of the corresponding CPython module,
as described below. For more information, refer to the original
CPython documentation: cpython:warnings
.
Available on these boards
- warnings.warn(message: str, category: type = Warning) None
Issue a warning with an optional category. Use
simplefilter()
to set if warnings are ignored, printed or raise an exception.