Skip to content

Instantly share code, notes, and snippets.

@razrichter
Created April 27, 2012 16:10
Show Gist options
  • Save razrichter/2510475 to your computer and use it in GitHub Desktop.
Save razrichter/2510475 to your computer and use it in GitHub Desktop.
Simple python enum
# as copied from http://stackoverflow.com/a/1695250
def enum(*sequential, **named):
enums = dict(zip(sequential, range(len(sequential))), **named)
return type('Enum', (), enums)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment