
Sept. 25, 2009
11:42 p.m.
Terry Reedy schrieb:
Andrey Fedorov wrote:
What is the tradeoff between hasattr(f, '__call__')
I know about that ;-)
and isinstance(f, Callable)?
New to me ;-) I presume it needs an import. I presume it also requires that something be registered as a Callable.
Nope; it uses the new instance/subclass inquiry hooks to pretend all objects having a __call__ attribute are instances of Callable. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out.