Wrapping methods of built-in dict

I V ivlenin at gmail.com
Wed May 20 23:01:23 EDT 2009


On Thu, 21 May 2009 02:31:29 +0000, Steven D'Aprano wrote:
> So the problem isn't directly with getmembers, but with the predicate
> functions you have passed to it (inspect.isfunction and inspect.method).
> Try inspect.ismethoddescriptor instead.

Or perhaps callable ? callable({}.get) and callable(dict.get) are both 
true, although I don't know if that's guaranteed (I'm wondering if 
methods could be implemented with an object such that 
method_object.__get__ returned a callable, but where method_object itself 
wasn't callable).



More information about the Python-list mailing list