Package tlib :: Package base :: Module TLibHelper
[hide private]
[frames] | no frames]

Source Code for Module tlib.base.TLibHelper

 1  import warnings 
 2   
3 -def deprecated(func):
4 '''This is a decorator which can be used to mark functions 5 as deprecated. It will result in a warning being emitted 6 when the function is used.''' 7 def new_func(*args, **kwargs): 8 warnings.warn("Call to deprecated function {}.".format(func.__name__), 9 category=DeprecationWarning) 10 return func(*args, **kwargs)
11 new_func.__name__ = func.__name__ 12 new_func.__doc__ = func.__doc__ 13 new_func.__dict__.update(func.__dict__) 14 return new_func 15