Gabriel Genellina a écrit :
> If you want to review the original discussion on how to spell a
> generator expression (called "accumulator display" by that time) see
> http://mail.python.org/pipermail/python-dev/2003-October/038868.html
That's a long discussion... and it seem I'm not alone to disli
En Wed, 07 Mar 2007 15:21:57 -0300, Laurent Pointal
<[EMAIL PROTECTED]> escribió:
> Gabriel Genellina wrote:
>
>> En Wed, 07 Mar 2007 12:53:43 -0300, Laurent Pointal
>> <[EMAIL PROTECTED]> escribió:
>>
>>> Why does Python allow generator expression parenthesis to be mixed with
>>> function call
Gabriel Genellina wrote:
> En Wed, 07 Mar 2007 12:53:43 -0300, Laurent Pointal
> <[EMAIL PROTECTED]> escribió:
>
> f(4,i for i in range(10))
>> File "", line 1
>> SyntaxError: invalid syntax
>
> 2.5 has a better error message:
> py> f(4,i for i in range(10))
>File "", line 1
> SyntaxEr
Dennis Lee Bieber wrote:
> On Wed, 07 Mar 2007 17:15:33 +0100, Laurent Pointal
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
>>
>> How a Python beginner know that he is using a generator and not a
>> list-comprehension ?
>>
> A list comprehension ALWAYS has list brackets [
En Wed, 07 Mar 2007 12:53:43 -0300, Laurent Pointal
<[EMAIL PROTECTED]> escribió:
f(4,i for i in range(10))
> File "", line 1
> SyntaxError: invalid syntax
2.5 has a better error message:
py> f(4,i for i in range(10))
File "", line 1
SyntaxError: Generator expression must be parenthes
Facundo Batista a écrit :
> Laurent Pointal wrote:
>
>
> f(4,i for i in range(10))
>> File "", line 1
>> SyntaxError: invalid syntax
>>
>>
>> Why does Python allow generator expression parenthesis to be mixed with
>> function call parenthesis when there is only one parameter ?
>
> For simp
Laurent Pointal wrote:
f(4,i for i in range(10))
> File "", line 1
> SyntaxError: invalid syntax
>
>
> Why does Python allow generator expression parenthesis to be mixed with
> function call parenthesis when there is only one parameter ?
For simplicity and elegant coding, so you can do so