from collections import namedtuple
Foo = namedtuple('Foo', ['item1', 'item2'], verbose=False)


class ExtendedFoo(Foo):

    def __hash__(self):
        return hash(self.item1) * hash(self.item2)
foo = ExtendedFoo(1, 2)
hash(foo)
Creating a namedtuple with a custom hash function