def deprecatedWorkerClassProperty(scope, prop, compat_name=None, new_name=None):
 if (new_name is None):
  scope_keys = list(scope.keys())
  scope_values = list(scope.values())
  attribute_name = scope_keys[scope_values.index(prop)]
 else:
  attribute_name = new_name
 compat_name = _compat_name(attribute_name, compat_name=compat_name)
 if attribute_name:
  advice_msg = "use '{0}' instead".format(attribute_name)
 else:
  advice_msg = "don't use it"
 def get(self):
  reportDeprecatedWorkerNameUsage("'{old}' property is deprecated, {advice}.".format(old=compat_name, advice=advice_msg))
  return getattr(self, attribute_name)
 assert (compat_name not in scope)
 scope[compat_name] = property(get)

def deprecatedWorkerClassProperty ( scope , prop , compat_name = None , new_name = None ) : if ( new_name is None ) : scope_keys = list ( scope . keys ( ) ) scope_values = list ( scope . values ( ) ) attribute_name = scope_keys [ scope_values . index ( prop ) ] else : attribute_name = new_name compat_name = _compat_name ( attribute_name , compat_name = compat_name ) if attribute_name : advice_msg = "use '{0}' instead" . format ( attribute_name ) else : advice_msg = "don't use it" def get ( self ) : reportDeprecatedWorkerNameUsage ( "'{old}' property is deprecated, {advice}." . format ( old = compat_name , advice = advice_msg ) ) return getattr ( self , attribute_name ) assert ( compat_name not in scope ) scope [ compat_name ] = property ( get )
define compatibility class property .