def _AddPropertiesForNonRepeatedCompositeField(field, cls):
 proto_field_name = field.name
 property_name = _PropertyName(proto_field_name)
 message_type = field.message_type
 def getter(self):
  field_value = self._fields.get(field)
  if (field_value is None):
   field_value = message_type._concrete_class()
   field_value._SetListener(self._listener_for_children)
   field_value = self._fields.setdefault(field, field_value)
  return field_value
 getter.__module__ = None
 getter.__doc__ = ('Getter for %s.' % proto_field_name)
 def setter(self, new_value):
  raise AttributeError(('Assignment not allowed to composite field "%s" in protocol message object.' % proto_field_name))
 doc = ('Magic attribute generated for "%s" proto field.' % proto_field_name)
 setattr(cls, property_name, property(getter, setter, doc=doc))

def _AddPropertiesForNonRepeatedCompositeField ( field , cls ) : proto_field_name = field . name property_name = _PropertyName ( proto_field_name ) message_type = field . message_type def getter ( self ) : field_value = self . _fields . get ( field ) if ( field_value is None ) : field_value = message_type . _concrete_class ( ) field_value . _SetListener ( self . _listener_for_children ) field_value = self . _fields . setdefault ( field , field_value ) return field_value getter . __module__ = None getter . __doc__ = ( 'Getter for %s.' % proto_field_name ) def setter ( self , new_value ) : raise AttributeError ( ( 'Assignment not allowed to composite field "%s" in protocol message object.' % 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 .