How to declare a module deprecated in python

You want to warn with a DeprecationWarning.

Exactly how you call it doesn’t matter that much, but the stdlib has a standard pattern for deprecated modules, like this:

# doc string, top-level comments, imports, __all__ =

import warnings
warnings.warn("the spam module is deprecated", DeprecationWarning,
              stacklevel=2)

# normal module code

See the 2.7 sets source for an example.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)