[Python-Dev] Enumeration items: type(EnumClass.item) is EnumClass
? (original) (raw)
Guido van Rossum guido at python.org
Mon Apr 29 22:00:41 CEST 2013
- Previous message: [Python-Dev] Enumeration items: `type(EnumClass.item) is EnumClass` ?
- Next message: [Python-Dev] Enumeration item arguments?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Apr 29, 2013 at 12:52 PM, Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:
Would it not be better to avoid using isinstance() for this?
In a recent thread I explained why using isinstance() is important. It's how we check for every other type, and it would be awlward for type-checking frameworks to have to special-case enums. (When we're not using duck typing.)
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] Enumeration items: `type(EnumClass.item) is EnumClass` ?
- Next message: [Python-Dev] Enumeration item arguments?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]