On this page
  1. warnings.showwarning
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

warnings.showwarning

Prev: warnings.resetwarnings | Up: warnings | Next: warnings.simplefilter
Rel: warnings.catch_warnings, warnings.deprecated, warnings.filterwarnings, warnings.formatwarning
Ref: docs.python.org — warnings.showwarning
Tags: #public #python3 #stdlib #warnings


Import

import warnings
from warnings import showwarning

Signature & Overview

warnings.showwarning(message, category, filename, lineno, file=None, line=None)

Hook to write a warning to a file; replace if you like.

Usage

import warnings

# Hook invoked whenever a warning is not filtered out (defaults to writing to sys.stderr)
assert callable(warnings.showwarning)

Gotchas

REPL Inspect

from warnings import showwarning
help(showwarning)

Linked from

Related notes