Never been to DZone Snippets before? Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world From Alex's recipe. 1 2 # Put in const.py...: 3 class _const: 4 class ConstError(TypeError): pass 5 def __setattr__(self,name,value): 6 if self.__dict__.has_key(name): 7 raise self.ConstErr