On Wed, Dec 19, 2007 at 09:41:13PM -0500, bob gailer wrote: > 1 - I see no value in introducing variables. I'd just use string constants: > > action = "moving" > . > . > if action == "jumping": > > etc.
I agree. But, some people do prefer something that looks a bit like an enum. If so, here is a Python idiom for enums: Mode_none, Mode_moving, Mode_inserting, Mode_jumping = range(4) action = Mode_moving if action == Mode_jumping: o o o - Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor