def _AddPropertiesForExtensions(descriptor, cls):
 extension_dict = descriptor.extensions_by_name
 for (extension_name, extension_field) in extension_dict.iteritems():
  constant_name = (extension_name.upper() + '_FIELD_NUMBER')
  setattr(cls, constant_name, extension_field.number)

def _AddPropertiesForExtensions ( descriptor , cls ) : extension_dict = descriptor . extensions_by_name for ( extension_name , extension_field ) in extension_dict . iteritems ( ) : constant_name = ( extension_name . upper ( ) + '_FIELD_NUMBER' ) setattr ( cls , constant_name , extension_field . number )
adds properties for all fields in this protocol message type .