PyDocs

Nav

Python Runtime Services

warn

warnings

function
  • warn(message, category=None, stacklevel=1, source=None, *, skip_file_prefixes=())
Issue a warning, or maybe ignore it or raise an exception.

message
  Text of the warning message.
category
  The Warning category subclass. Defaults to UserWarning.
stacklevel
  How far up the call stack to make this warning appear. A value of 2 for
  example attributes the warning to the caller of the code calling warn().
source
  If supplied, the destroyed object which emitted a ResourceWarning
skip_file_prefixes
  An optional tuple of module filename prefixes indicating frames to skip
  during stacklevel computations for stack frame attribution.
Changed in 3.6, 3.12
  • 3.6: Added source parameter.
  • 3.12: Added skip_file_prefixes.
0 Examples
No examples for warnings/warn.
See Also
No see-alsos for warnings/warn
0 Notes
No notes for warn