[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
Guido van Rossum
guido at python.org
Tue Apr 23 17:58:06 CEST 2013
You seem to be mixing up classes and metaclasses.
On Tue, Apr 23, 2013 at 8:46 AM, Scott Dial
<scott+python-dev at scottdial.com> wrote:
> On 4/23/2013 10:53 AM, R. David Murray wrote:
>> Ah. I'd be looking for a bug every time I saw isinstance(value,
>> myEnumClass). A better class name for values and an API for
>> getting that class from the EnumClass would be nice, though.
>> (So that you could write "isinstance(value, MyEnumClass.ValueClass)",
> Reading what you have wrote, it seems that the issue is whether you
> consider an instance of Enum a "thing" or a "class of things". If you
> think of it as a "thing", then "C" is a object that has attributes for
> other "things" that are not like "C". However, if you think of "C" as a
> "class of things", then "C" having attributes that are instances of it's
> type is completely natural.
> Fundamentally, the question is whether an instance of Enum is a new type
> or an instance. And for me, it's a new type and I expect enum values to
> be instance of that type.
> Scott Dial
> scott at scottdial.com
> Python-Dev mailing list
> Python-Dev at python.org
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
--Guido van Rossum (python.org/~guido)
More information about the Python-Dev