Re: [Python-Dev] enum instances

2013-04-30 Thread Nikolaus Rath
On 04/30/2013 07:05 PM, Nikolaus Rath wrote: > Larry Hastings writes: >> On 04/29/2013 07:42 PM, Nikolaus Rath wrote: >>> State is a class, it just inherits from enum. Thus: >>> >>> type(State) == type(enum) == type(EnumMetaclass) >>> issubclass(State, enum) == True >>> >> >> If you'd tried it, yo

Re: [Python-Dev] enum instances

2013-04-30 Thread Ethan Furman
On 04/30/2013 07:05 PM, Nikolaus Rath wrote: Larry Hastings writes: On 04/29/2013 07:42 PM, Nikolaus Rath wrote: State is a class, it just inherits from enum. Thus: type(State) == type(enum) == type(EnumMetaclass) issubclass(State, enum) == True HTH, -Nikolaus If you'd tried it, you

Re: [Python-Dev] enum instances

2013-04-30 Thread Larry Hastings
On 04/30/2013 07:05 PM, Nikolaus Rath wrote: Larry Hastings writes: On 04/29/2013 07:42 PM, Nikolaus Rath wrote: State is a class, it just inherits from enum. Thus: type(State) == type(enum) == type(EnumMetaclass) issubclass(State, enum) == True HTH, -Nikolaus If you'd tried it, you'

Re: [Python-Dev] enum instances

2013-04-30 Thread Nikolaus Rath
Larry Hastings writes: > On 04/29/2013 07:42 PM, Nikolaus Rath wrote: >> State is a class, it just inherits from enum. Thus: >> >> type(State) == type(enum) == type(EnumMetaclass) >> issubclass(State, enum) == True >> >> >> HTH, >> >> -Nikolaus > > If you'd tried it, you'd have found that that

Re: [Python-Dev] enum instances

2013-04-29 Thread Larry Hastings
On 04/29/2013 07:42 PM, Nikolaus Rath wrote: State is a class, it just inherits from enum. Thus: type(State) == type(enum) == type(EnumMetaclass) issubclass(State, enum) == True HTH, -Nikolaus If you'd tried it, you'd have found that that isn't true. enum has a metaclass, EnumMetaclas

Re: [Python-Dev] enum instances

2013-04-29 Thread Nikolaus Rath
Marco Hemmelrath writes: > class State(enum): > idle = 0 > busy = 1 > idling = idle > ideling = 0 > > together with the premises: > > 1. type(State.busy) == State > 2. type(State) == enum State is a class, it just inherits from enum. Thus: type(State)

Re: [Python-Dev] enum instances

2013-04-29 Thread Ethan Furman
On 04/29/2013 06:23 PM, Marco Hemmelrath wrote: First of all, hi, I'm new to this list. Following the enum discussions on this list I am kind of confused about how enums and their respective instances, i.e. the values, should behave in "normal" context. I apologize beforehand for the mass of "q

[Python-Dev] enum instances

2013-04-29 Thread Marco Hemmelrath
First of all, hi, I'm new to this list. Following the enum discussions on this list I am kind of confused about how enums and their respective instances, i.e. the values, should behave in "normal" context. I apologize beforehand for the mass of "questions" because the following contains really