See the frozendict recipe: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/414283 It was written exactly for this purpose: a dictionary that can be a member in a set. Oren