Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

Antoon Pardon antoon.pardon at rece.vub.ac.be
Tue Apr 8 03:03:34 EDT 2014


On 07-04-14 07:10, Steven D'Aprano wrote:
>
>> Restricting the usage of Python's flexibility does not make it another
>> language. It makes it the actual language that the vast majority of
>> programs are written in and that people assume when reading code.
> That's incorrect. If len were a keyword, and couldn't be shadowed or 
> replaced, it would be another language. 

That is true but in a useless meaning. With such a strict meaning of
when a language is different, people programming python have been
continuously changing programming language. However the changes
seem to be gradual enough for people to continue speaking of python.

So if we see python as a family of languages where some difference
may produce variations while still speaking of the same language,
I don't see why a change like you propose would fall into a category
that would imply we are now speaking of an other language.

-- 
Antoon Pardon




More information about the Python-list mailing list