Closed robertwb closed 7 years ago
Modified by nikratio on 24 Oct 2011 00:33 UTC
Comment by nikratio on 26 Oct 2011 16:24 UTC Consensus on -users was that special casing lambda to convert void to None is not a good idea, and adding a new keyword "clambda" is not reasonable just to save two lines of code for defining a named function. So I guess we can forgot about this idea (I don't seem to have permission to change the ticket status).
Modified by scoder on 9 Jan 2012 15:14 UTC
Reported by nikratio on 24 Oct 2011 00:33 UTC Currently, it is not possible to use lambda with a C function:
This is of course a legitimate error, it's not clear what the lambda expression is supposed to return.
However, that means that creation of a Python wrapper for a C function always requires explicit definition of the function. It would be very nice to have a way around that.
My suggestion is therefore to treat any call to C function of type void as returning None, so that the following expression becomes valid:
Migrated-From: http://trac.cython.org/ticket/751