[Cython] Bug report: lambda and numpy.vectorize segfaults

Stefan Behnel stefan_ml at behnel.de
Wed Mar 23 17:56:26 CET 2011

Vitja Makarov, 23.03.2011 17:25:
> def f():
>      return lambda x=0: x
> f()()

Gives me this bogus code at function entry:

     Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
     PyObject* values[1] = {0};
     values[0] = ((PyObject *)0);  // <<<<<<< !!!

Looks like the default value is considered an int, whereas x is of type 
object, and there's a coercion missing between the two.


More information about the cython-devel mailing list