[Cython] implementation of cdef functions with default arguments

Lisandro Dalcin dalcinl at gmail.com
Fri Apr 1 18:57:08 CEST 2011


Perhaps I'm missing something, but why we need the intermediate
struct? Why not generate a regular C function with all the args, and
then generate the call providing arguments? We could even extend this
to support kwargs for calling functions in Cython,

1 - The implementation would be cleaner, IMHO.
2 - These functions cannot be easily used in external C code (or
course, C code should provide all the args)
3 - We could define default args for "cdef extern" C functions, Cython
would provide the arg values on call.
4 - We could add support to pass values as kwargs (well, we could do
that with the current implementation).
5 - Faster code?

Comments?

-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169


More information about the cython-devel mailing list