Python code snippet - creating enums in python

Jul 18, 2012 12:40

There's a ton of "enum" implementations for python, using named tuples, or a special class, or other things. I wanted something that looked as much as possible as an integer, but it was easy to create new instances using a symbolic name, have it print out (repr format) with that name, but otherwise be treated like any other integer ( Read more... )

python enum

Leave a comment

thaily July 18 2012, 19:42:01 UTC
Holy fuckballs, it's a Ch'marr!

Reply

chmarr July 18 2012, 19:54:25 UTC
Apparently I'm alive, against all reason!

Reply

thaily July 18 2012, 19:59:55 UTC
Against all lacking signs thereof, how've you been old bean?

Reply

chmarr July 23 2012, 22:38:39 UTC
Its been somewhat of a roller coaster... and in the process of deciding if I want to ride it again, now :)

Reply

wolphin July 19 2012, 14:43:14 UTC
Are you sure? We should get a second opinion on that. You can never trust zombies you know.

Reply


Leave a comment

Up