On Fri, Apr 26, 2013 at 12:38 PM, Guido van Rossum <gu...@python.org> wrote:
> If the above syntax won't work, that isinstance() outcome isn't really
> important. :-(
>
> Can't we do some kind of callable check? There may be some weird
> decorators that won't work, but they aren't likely to be useful in
> this context.

Yeah, it may not be as tricky as I feared: adding "not
callable(attr_val)" to the conditions for deciding whether or not to
convert a class attribute to an instance of the enum would likely
suffice to address the method problem.

You couldn't create an enum of callables, but that would be a
seriously weird thing to do anyway....

Cheers,
Nick.

--
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to