diff -ru Python-3.6.1-old/Lib/inspect.py Python-3.6.1-new/Lib/inspect.py --- Python-3.6.1-old/Lib/inspect.py 2017-03-21 07:32:38.000000000 +0100 +++ Python-3.6.1-new/Lib/inspect.py 2017-04-14 13:35:34.452589707 +0200 @@ -166,7 +166,7 @@ __globals__ global namespace in which this function was defined __annotations__ dict of parameter annotations __kwdefaults__ dict of keyword only parameters with defaults""" - return isinstance(object, types.FunctionType) + return "__code__" in dir(object) def isgeneratorfunction(object): """Return true if the object is a user-defined generator function.