ABCs, functions, and __call__ (Python3)

andrew cooke andrew at acooke.org
Fri Jan 16 20:06:21 EST 2009


I think I'm missing something obvious here, so apologies in advance.

I'd like to be able to test whether something is a function or
implements __call__.  Now obviously I can do that as two separate
tests, but I though this was what ABCs were for.  However, for the
life of me I cannot find what the correct ABC would be.  Does it
exist?  Is there some other, more traditional approach I should be
using?  Or do I have to roll my own somehow?

Thanks for any guidance,
Andrew



More information about the Python-list mailing list