Hi, please start a new thread when switching to a new topic.
Vitja Makarov, 27.11.2010 08:24: > I'm now trying to make "module scope lambda" work. > That's almost done. > > I see that needs_assignment_synthesis() should be forced to create > PyMethodDef struct. I would be happier if we could get rid of PyMethodDef in the long term, but it's clearly easier to keep it for now. > Now I do it this way: > def needs_assignment_synthesis(self, ...): > ..... > if self.name == '<lambda>': > ..... > > Seems like a dirty hack. Yes. Instead, use a new flag "is_lambda" on the entry. > Also lambda function is defined in module methods table as > __pyx_lambda_funcdef4lala_lambda1, > Is it safe not to add lambda cname to pyfunc_entries in > Scope.declare_lambda_function()? I don't know, you can try. In any case, it needs to do everything that a normal Python function does, except for adding its Python name to the defining scope. That's a rather small distinction. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
