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 '''Functioa that can be used to mark functions as deprecated. It will result in a warning being emitted 5 when the function is used.\n 6 To use it mark function with @deprecated decorator''' 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