    def __cmp__(self, other):
        return cmp(self.foo, other.foo)


class AnotherComparable(object):

    def __init__(self, baz='qux'):
        self.baz = baz

    def __hash__(self):
        return hash(self.baz)