[issue30071] Duck-typing inspect.isfunction()

Serhiy Storchaka report at bugs.python.org
Fri Apr 14 11:01:47 EDT 2017


Serhiy Storchaka added the comment:

__code__ is not enough for quacking as a function. Different code can expect other function attributes (for example __name__, __qualname__ and __module__).

See also issue8488. inspect.isroutine() and inspect.ismethoddescriptor() return True for some descriptors, but they don't quack good enough for pydoc.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30071>
_______________________________________


More information about the Python-bugs-list mailing list