Adds a __ne__ operator to Command. This is necessary for CmdSet.remove() to behave as expected.

This commit is contained in:
lagos 2012-11-02 15:08:59 -07:00
parent 92f6b06626
commit b1f4d9ceaa

View file

@ -148,6 +148,10 @@ class Command(object):
# probably got a string
return cmd in self._matchset
def __ne__(self, cmd):
"The logical negation of __eq__."
return not self.__eq__(cmd)
def __contains__(self, query):
"""
This implements searches like 'if query in cmd'. It's a fuzzy matching