Derived from the flake8-bugbear linter.
What it does#
warnings.warn calls without an explicit
Why is this bad?#
warnings.warn method uses a
stacklevel of 1 by default, which
limits the rendered stack trace to that of the line on which the
warn method is called.
It's recommended to use a
stacklevel of 2 or higher, give the caller
more context about the warning.