Add a named field to the schema.
        
        .. Warning:: the field name should not contains spaces and should not
            start with an underscore.
        
        :param name: name of the new field
        :type name: str
        :param field: type instance for the field 
        :type field: subclass of :class:`.GenericType`

def add_field(self, name, field):
        """ Add a named field to the schema.
        
        .. Warning:: the field name should not contains spaces and should not
            start with an underscore.
        
        :param name: name of the new field
        :type name: str
        :param field: type instance for the field 
        :type field: subclass of :class:`.GenericType`
        """
        # testing names 
        if name.startswith("_"):
            raise SchemaError("Field names cannot start with an underscore.")
        if " " in name:
            raise SchemaError("Field names cannot contain spaces.")
        if name in self._fields:
            raise SchemaError("Schema already has a field named '%s'" % name)
        if not isinstance(field, GenericType):
            raise SchemaError("Wrong type in schema for field: %s, %s is not a GenericType" % (name, field))
        self._fields[name] = field