Python Glossary Русский

all Python 3Exceptionsexception

PendingDeprecationWarning

built-in exceptions

A feature that will be deprecated in the future.

Syntax

raise PendingDeprecationWarning

This is a warning, not an error: nothing crashes, and by default the message is not even printed — run Python with -W always or set a filter via warnings to see it. It is rarely used today; already-deprecated APIs emit DeprecationWarning, and PendingDeprecationWarning is reserved for "still fine, but we may deprecate it later".

Examples

try:
    raise PendingDeprecationWarning
except PendingDeprecationWarning as e:
    print(type(e).__name__)   # → PendingDeprecationWarning

See also

Open in the full glossarydocs.python.orgReport an inaccuracy