2010/11/27 Vitja Makarov <[email protected]>:
> 2010/11/27 Stefan Behnel <[email protected]>:
>> Stefan Behnel, 27.11.2010 09:26:
>>> Vitja Makarov, 27.11.2010 09:17:
>>>> 2010/11/27 Stefan Behnel:
>>>>> Vitja Makarov, 27.11.2010 08:24:
>>>>>> 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.
>>>>
>>>> Seems to work fine. No regressions.
>>>
>>> Ok. IIRC, lambda functions are already kept in a different list. I wonder
>>> if that was a good idea. Maybe a flag right on the DefNode would have been
>>> a better way to do it.
>>
>> Rethink this a bit, a flag on the entry seems more useful here...
>>
>
> I think so too ;) Btw more generic flag will be needed someday.
>

http://trac.cython.org/cython_trac/ticket/308

Attached patch adds is_lambda to Entry and set this flag in
declare_lambda_function() then DefNode.needs_assignment_synthesis()
check for this flag. Seems rather simple.

-- 
vitja.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to