'Subclasses should implement this method for anything more complex than equality.'

def __contains__(self, other):

    if (type(self) == type(other)):
        return (self == other)
    raise NotImplementedError()
