[Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library (original) (raw)
Guido van Rossum guido at python.org
Fri Apr 26 00:37:16 CEST 2013
- Previous message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Next message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Apr 25, 2013 at 3:29 PM, Barry Warsaw <barry at python.org> wrote:
On Apr 25, 2013, at 03:19 PM, Guido van Rossum wrote:
I suppose you were going to propose to use isinstance() overloading, but I honestly think that Color.red.class should be the same object as Color. Yes, a custom instancecheck() is two lines of code. I just can't get over the weirdness of a class having attributes which are actual instances of itself.
TBH I had a hard time getting over the fact that even though the class said "a = 1", C.a is not the integer 1. But I did get over it. Hopefully you can get over this weirdness.
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Next message: [Python-Dev] PEP 435 -- Adding an Enum type to the Python standard library
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]