ABCs, functions, and __call__ (Python3)

A

andrew cooke

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top