How to deprecate a module in python
1 answer
Do you want warn
with DeprecationWarning
.
Exactly what you call it, it's not that important, but stdlib has a standard template for legacy 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 source 2.7sets
.
+6
source to share