Created
October 10, 2013 03:17
-
-
Save Ayrx/6912517 to your computer and use it in GitHub Desktop.
Code snippet for using enum in Python 2. http://stackoverflow.com/a/1695250/1170681
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def enum(**enums): | |
return type('Enum', (), enums) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment