Created
August 5, 2013 22:10
-
-
Save dcramer/6160037 to your computer and use it in GitHub Desktop.
This file contains hidden or 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(): | |
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