Skip to content

Instantly share code, notes, and snippets.

@dcramer
Created August 5, 2013 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcramer/6160037 to your computer and use it in GitHub Desktop.
Save dcramer/6160037 to your computer and use it in GitHub Desktop.
def Enum():
class GettattrDefaultDict(defaultdict):
def __getattr__(self, name):
return self[name]
return GettattrDefaultDict(iter(xrange(sys.maxint)).next)
Status = Enum()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment