<bg***@yahoo.comwrote in message
news:11*********************@11g2000cwr.googlegrou ps.com...
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 -
myState1[State.Fire] = 10
myState1[State.Earth] = 4
myState2[State.Fire] = 20
myState2[State.Earth] = 24
How do I do this?
Thanks Barry.
How about (arrays are sooo last century):
class State(object):
def __init__(self,**kwargs):
self.__dict__.update(kwargs)
myState1 = State(Fire=10, Earth=4)
myState2 = State(Fire=20, Earth=24)
print myState1.Fire
print myState2.Earth
-- Paul