[Cython] How to detect CyFunction?

Jeroen Demeyer jeroen.k.demeyer at gmail.com
Thu Aug 8 16:32:25 EDT 2019


Hi, I have a very technical question about
Cython.Compiler.Nodes.DefNode: how can I know whether the instance
represents a PyCFunction (built-in function) or a CyFunction (Cython
function)? I've tried all the obvious conditions such as checking
self.is_cyfunction, self.py_cfunc_node.binding and
env.directives['binding']

I'm asking because I want to implement METH_FASTCALL support for
PyCFunction instances. See https://github.com/cython/cython/pull/3021
To keep things simple, I don't want to deal with CyFunction initially.
But I really can't figure how to make that distinction from the
DefNode.


More information about the cython-devel mailing list