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

Chris Angelico rosuav at gmail.com
Tue Mar 25 03:17:51 CET 2014


On Tue, Mar 25, 2014 at 12:45 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> Programming is a skill, like writing iambic pentameter. Should liberal
> arts courses ban the use of iambic pentameter by poets because some
> people find it confusing and can't count syllables or tell the difference
> between stressed and unstressed? (I know I can't. My wife despairs that I
> am so useless at anything like poetry.)

Iambic pentameter is hard. I know, I tried writing eight lines of it
for my brother's wedding. (Okay, I was writing *acrostic* iambic
pentameter, putting his wife's new surname down the left edge of the
page, but still, it's pretty restrictive.) It's much more fun, I
reckon, to write paragraphs of text roughly eighty characters across.
Prosaic, I know....

ChrisA



More information about the Python-list mailing list