def _AddPropertiesForNonRepeatedScalarField(field, cls):
 proto_field_name = field.name
 property_name = _PropertyName(proto_field_name)
 type_checker = type_checkers.GetTypeChecker(field)
 default_value = field.default_value
 valid_values = set()
 def getter(self):
  return self._fields.get(field, default_value)
 getter.__module__ = None
 getter.__doc__ = ('Getter for %s.' % proto_field_name)
 def setter(self, new_value):
  self._fields[field] = type_checker.CheckValue(new_value)
  if (not self._cached_byte_size_dirty):
   self._Modified()
 setter.__module__ = None
 setter.__doc__ = ('Setter for %s.' % proto_field_name)
 doc = ('Magic attribute generated for "%s" proto field.' % proto_field_name)
 setattr(cls, property_name, property(getter, setter, doc=doc))

def _AddPropertiesForNonRepeatedScalarField ( field , cls ) : proto_field_name = field . name property_name = _PropertyName ( proto_field_name ) type_checker = type_checkers . GetTypeChecker ( field ) default_value = field . default_value valid_values = set ( ) def getter ( self ) : return self . _fields . get ( field , default_value ) getter . __module__ = None getter . __doc__ = ( 'Getter for %s.' % proto_field_name ) def setter ( self , new_value ) : self . _fields [ field ] = type_checker . CheckValue ( new_value ) if ( not self . _cached_byte_size_dirty ) : self . _Modified ( ) setter . __module__ = None setter . __doc__ = ( 'Setter for %s.' % proto_field_name ) doc = ( 'Magic attribute generated for "%s" proto field.' % proto_field_name ) setattr ( cls , property_name , property ( getter , setter , doc = doc ) )
adds a public property for a nonrepeated .