1. Matt Chaput
  2. whoosh
  3. Issues
Issue #374 resolved

__ne__ is not defined for whoosh.analysis.filters.Filter

smlz
created an issue

Filter.__ne__ is not defined, which can lead to unexpected results when comparing filters:

>>> from whoosh.analysis.filters import LowercaseFilter
>>> LowercaseFilter() == LowercaseFilter()
True
>>> not (LowercaseFilter() == LowercaseFilter())
False
>>> LowercaseFilter() != LowercaseFilter()
True

Simply define a __ne__ method:

def __ne__(self, other):
    return not (self == other)

Comments (1)

  1. Log in to comment