def deprecated(func, name='Unknown'):
 def newFunc(*args, **kwargs):
  warnings.warn(('Call to deprecated function %s.' % name), category=DeprecationWarning)
  return func(*args, **kwargs)
 newFunc.__name__ = func.__name__
 newFunc.__doc__ = func.__doc__
 newFunc.__dict__.update(func.__dict__)
 return newFunc

def deprecated ( func , name = 'Unknown' ) : def newFunc ( * args , ** kwargs ) : warnings . warn ( ( 'Call to deprecated function %s.' % name ) , category = DeprecationWarning ) return func ( * args , ** kwargs ) newFunc . __name__ = func . __name__ newFunc . __doc__ = func . __doc__ newFunc . __dict__ . update ( func . __dict__ ) return newFunc
this is a decorator used to mark functions as deprecated .