[EMAIL PROTECTED] wrote:
> Hi,
>
> I have the following enum -
>
> class State:
>       Fire = 0
>       Water = 1
>       Earth = 2
>
> And I want a variable which holds a value for each of these states,
> something like -
>   

class State:
        Fire = 0
        Water = 1
        Earth = 2


myState = {} # It is a dictionary, see 
http://docs.python.org/tut/node7.html#SECTION007500000000000000000
myState[State.Fire] = 20
myState[State.Earth] = 24
print myState

{0: 20, 2: 24}


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to