def _BytesForNonRepeatedElement(value, field_number, field_type):
 try:
  fn = type_checkers.TYPE_TO_BYTE_SIZE_FN[field_type]
  return fn(field_number, value)
 except KeyError:
  raise message_mod.EncodeError(('Unrecognized field type: %d' % field_type))

def _BytesForNonRepeatedElement ( value , field_number , field_type ) : try : fn = type_checkers . TYPE_TO_BYTE_SIZE_FN [ field_type ] return fn ( field_number , value ) except KeyError : raise message_mod . EncodeError ( ( 'Unrecognized field type: %d' % field_type ) )
returns the number of bytes needed to serialize a non-repeated element .