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

Comments 8

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


blue_panther July 18 2012, 21:42:06 UTC
Why - hello there! :D Now this is a post in my List, I wasn't expecting...

Reply


brentos_oh_yeah July 21 2012, 08:03:40 UTC
I thought you died in 'Nam or something...

Reply

chmarr July 23 2012, 22:38:51 UTC
I think I might have!

Reply


Leave a comment

Up