Re: Enum vs OrderedEnum

2013-08-07 Thread Neil Cerutti
On 2013-08-07, Ian Kelly wrote: > On Tue, Aug 6, 2013 at 7:55 PM, Ben Finney wrote: >> Ian Kelly writes: >> Terrain that is ?radiated? would be terrain that has some kind of spokes >> spreading out from its centre. I think you mean ?irradiated?. >> >> Hope the game goes well :-) > > It's actuall

Re: Enum vs OrderedEnum

2013-08-07 Thread Ian Kelly
On Tue, Aug 6, 2013 at 6:33 PM, Ethan Furman wrote: > class Environment(AutoNumber): > > gaia = 2.0 > fertile = 1.5 > terran = 1.0 > jungle = 1.0 > ocean = 1.0 > arid = 1.0 > steppe = 1.0 > desert = 1.0 > minimal = 1.0 > barren = 0.5 > tundra = 0.5 >

Re: Enum vs OrderedEnum

2013-08-07 Thread Ian Kelly
On Tue, Aug 6, 2013 at 7:55 PM, Ben Finney wrote: > Ian Kelly writes: > Terrain that is “radiated” would be terrain that has some kind of spokes > spreading out from its centre. I think you mean “irradiated”. > > Hope the game goes well :-) It's actually a reimplementation of a game from 1993, s

Re: Enum vs OrderedEnum

2013-08-06 Thread Ben Finney
Ian Kelly writes: > class Environment(OrderedEnum): I have nothing to add regarding the Python code, but I wanted to make a language correction: > gaia = 1 > fertile = 2 > terran, jungle, ocean, arid, steppe, desert, minimal = range(3, 10) > barren, tundra, dead, inferno, toxic,

Re: Enum vs OrderedEnum

2013-08-06 Thread Ethan Furman
On 08/06/2013 04:46 PM, Ian Kelly wrote: On Aug 6, 2013 5:15 PM, "Ethan Furman" mailto:et...@stoneleaf.us>> wrote: Use the .value attribute instead. You could also substitute self for Environment. It feels more natural and readable to compare the enum instances rather than their value att

Re: Enum vs OrderedEnum

2013-08-06 Thread Rhodri James
On Wed, 07 Aug 2013 00:46:39 +0100, Ian Kelly wrote: On Aug 6, 2013 5:15 PM, "Ethan Furman" wrote: Use the .value attribute instead. You could also substitute self for Environment. It feels more natural and readable to compare the enum instances rather than their value attributes. If I

Re: Enum vs OrderedEnum

2013-08-06 Thread Ian Kelly
On Aug 6, 2013 5:15 PM, "Ethan Furman" wrote: > > Use the .value attribute instead. You could also substitute self for Environment. It feels more natural and readable to compare the enum instances rather than their value attributes. If I am ordering the values then that seems to imply that the e

Re: Enum vs OrderedEnum

2013-08-06 Thread Ethan Furman
On 08/06/2013 04:00 PM, Ian Kelly wrote: Use the .value attribute instead. You could also substitute self for Environment. class Environment(Enum): gaia = 1 fertile = 2 terran, jungle, ocean, arid, steppe, desert, minimal = range(3, 10) barren, tundra, dead, inferno, tox

Enum vs OrderedEnum

2013-08-06 Thread Ian Kelly
Using the OrderedEnum recipe from the Python 3.4 docs, I have the following code: class Environment(OrderedEnum): gaia = 1 fertile = 2 terran, jungle, ocean, arid, steppe, desert, minimal = range(3, 10) barren, tundra, dead, inferno, toxic, radiated = range(10, 16) def is_st