Stefan Behnel added the comment:

>> inspect.isbuiltin() returns False
> Are you absolutely sure about this?

Yes. The "inheritance" of Cython's function type from PyCFunction is a pure
implementation detail of the object struct layout that is not otherwise
visible in any way. Specifically, there is no base type. The only reason
for the identical (start of the) struct layout is to allow reusing some of
the normal PyCFunction C-API functions on it instead of having to copy them
into Cython.

Cython's functions are neither instances of PyFunction nor of PyCFunction.
They implement the interface of PyFunction, though.

> http://hg.python.org/cpython/rev/48c3c42e3e5c

This change is redundant since BuiltinFunctionType (which isbuiltin() tests
for) is already in _NonUserDefinedCallables, which is tested for right
afterwards.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17159>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to