'Implements the [] operator. Used to set filters.
If the filter string is empty or not a string, raises BadFilterError. If
the value is not a supported type, raises BadValueError.'

def __setitem__(self, filter, value):

    if isinstance(value, tuple):
        value = list(value)
    datastore_types.ValidateProperty('    ', value)
    match = self._CheckFilter(filter, value)
    property = match.group(1)
    operator = match.group(3)
    dict.__setitem__(self, filter, value)
    if ((operator in self.INEQUALITY_OPERATORS) and (property != datastore_types._UNAPPLIED_LOG_TIMESTAMP_SPECIAL_PROPERTY)):
        if (self.__inequality_prop is None):
            self.__inequality_prop = property
        else:
            assert (self.__inequality_prop == property)
        self.__inequality_count += 1
    if (filter not in self.__filter_order):
        self.__filter_order[filter] = self.__filter_counter
        self.__filter_counter += 1
