[Python-ideas] list / array comprehensions extension

Steven D'Aprano steve at pearwood.info
Thu Dec 15 18:53:02 CET 2011

Michael Foord wrote:
> On 15 December 2011 17:35, Alexander Heger <python at 2sn.net> wrote:
>> Dear Masklinn,
>> thanks for your suggested solution.
>> I know all of these, but
>> 1) it is not as elegant or short
>> 2) why does unpacking not work syntactically the same as for the function
>> parameters?
>> It seems a natural extension that appears not to have a syntactic
>> conflict.  If it is not even a necessity for consistency.
>> So, the point is not that something like
>> [0,*x,0,*y,0]
>> can't be done in other ways, but that it can't be done in a neat way.
> I quite like that (suggested) syntax.

So do I. But I question the need for it.



More information about the Python-ideas mailing list