def deprecatedWorkerClassMethod(scope, method, compat_name=None):
 method_name = method.__name__
 compat_name = _compat_name(method_name, compat_name=compat_name)
 assert (compat_name not in scope)
 def old_method(self, *args, **kwargs):
  reportDeprecatedWorkerNameUsage("'{old}' method is deprecated, use '{new}' instead.".format(new=method_name, old=compat_name))
  return getattr(self, method_name)(*args, **kwargs)
 functools.update_wrapper(old_method, method)
 scope[compat_name] = old_method

def deprecatedWorkerClassMethod ( scope , method , compat_name = None ) : method_name = method . __name__ compat_name = _compat_name ( method_name , compat_name = compat_name ) assert ( compat_name not in scope ) def old_method ( self , * args , ** kwargs ) : reportDeprecatedWorkerNameUsage ( "'{old}' method is deprecated, use '{new}' instead." . format ( new = method_name , old = compat_name ) ) return getattr ( self , method_name ) ( * args , ** kwargs ) functools . update_wrapper ( old_method , method ) scope [ compat_name ] = old_method
define old-named method inside class .