Skip to content

Instantly share code, notes, and snippets.

View zheplusplus's full-sized avatar

Zhe Lin zheplusplus

View GitHub Profile
@kgriffs
kgriffs / util.py
Created December 31, 2013 20:49
Deprecated decorator for Python. Uses clever introspection to set a helpful filename and lineno in the warning message.
import functools
import inspect
import warnings
# NOTE(kgriffs): We don't want our deprecations to be ignored by default,
# so create our own type.
class DeprecatedWarning(UserWarning):
pass