creating an immutable type ?

a dictionary can only use immutable types as keys but i would like to use objects of my own class as keys. how can i create my own immutable type in python?

This is not really a blender python question, but…

Look into adding the hash attribute to your class. The manual has an explanation of it (just search the python manual for hash).

Also a quick googling found: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/83698