diff options
Diffstat (limited to 'numpy/__init__.py')
-rw-r--r-- | numpy/__init__.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/numpy/__init__.py b/numpy/__init__.py index 1029652c8..772c75b63 100644 --- a/numpy/__init__.py +++ b/numpy/__init__.py @@ -121,6 +121,17 @@ class ModuleDeprecationWarning(DeprecationWarning): pass +class VisibleDeprecationWarning(UserWarning): + """Visible deprecation warning. + + By default, python will not show deprecation warnings, so this class + can be used when a very visible warning is helpful, for example because + the usage is most likely a user bug. + + """ + pass + + # oldnumeric and numarray were removed in 1.9. In case some packages import # but do not use them, we define them here for backward compatibility. oldnumeric = 'removed' @@ -145,7 +156,7 @@ else: except ImportError: msg = """Error importing numpy: you should not try to import numpy from its source directory; please exit the numpy source tree, and relaunch - your python intepreter from there.""" + your python interpreter from there.""" raise ImportError(msg) from .version import git_revision as __git_revision__ from .version import version as __version__ @@ -157,7 +168,9 @@ else: return loader(*packages, **options) from . import add_newdocs - __all__ = ['add_newdocs', 'ModuleDeprecationWarning'] + __all__ = ['add_newdocs', + 'ModuleDeprecationWarning', + 'VisibleDeprecationWarning'] pkgload.__doc__ = PackageLoader.__call__.__doc__ |