[Cython] [Bug] Don't compile lambda with tuple argument.

Robert Bradshaw robertwb at gmail.com
Tue Nov 10 00:25:52 EST 2015


On Mon, Nov 9, 2015 at 4:15 PM, yi huang <yi.codeplayer at gmail.com> wrote:
> Even function with tuple match parameter don't work either.
>
> ```
> def test((name, v)):
>     return True
> ```
>
> ```
> Error compiling Cython file:
> ------------------------------------------------------------
> ...
> def test((name, v)):
>                  ^
> ------------------------------------------------------------
>
> /private/tmp/test.pyx:3:18: Empty declarator
> ```
>
> On Tue, Nov 10, 2015 at 8:01 AM, yi huang <yi.codeplayer at gmail.com> wrote:
>> λ $ cat /tmp/test.pyx
>> f = lambda (name,v):True
>>
>> λ $ cython /tmp/test.pyx
>>
>> Error compiling Cython file:
>> ------------------------------------------------------------
>> ...
>> f = lambda (name,v):True
>>                   ^
>> ------------------------------------------------------------
>>
>> /tmp/test.pyx:1:19: Empty declarator
>>
>>
>> Tested with both 0.21 and 0.23

Yes, this went away in Python 3 as well:
https://www.python.org/dev/peps/pep-3113/ .


More information about the cython-devel mailing list