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

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Mar 28 00:45:37 EDT 2014


On Thu, 27 Mar 2014 17:14:09 -0500, Mark H Harris wrote:

> People want to use their computer. They want to solve problems with
> it... and frankly, they would like to know how to program it, if there
> where some royal road, or fast track, or short and easy tutorial. 

Most people want to program their computer in the same way they want to 
crawl around under their car changing the grease and oil. People want to 
use their computer, but they would prefer the computer already have an 
app to solve their problem. Some will program only if that is the only 
way to get the computer to do what they want. Most won't even do that.

If you ask the average Python-using biologist if they want to be a 
programmer, they will say something like "If I wanted to be a programmer, 
I would have done a comp sci degree. I want to be a biologist, and 
unfortunately having to program comes with the territory, like the other 
tedious jobs I have to do. I didn't do six years of college to wash test 
tubes or write code, but that's part of the job."


> I know
> lots of people that will sit down and try (with a cup of Java) and hack
> it out if they have a good short book.

There are seven billion people on planet Earth. If only one in ten 
thousand wants to program, that's still "lots of people".

But in any case, we're not talking about people who want to program and 
are willing to read a book to learn. We are talking about this subset of 
people who want to program without learning to program, and in particular 
your insistence that they count for more than programmers who want to 
learn to program.


[...]
> Just look on the list:  Fred Sells meta language request.  He proves my
> point entirely.

If I were Fred, I'd probably be insulted by that. He clearly knows 
programming jargon, and can use it correctly, and he is talking about 
being pressed for time and short on management support, which most 
programmers can relate to. What reason do you have to conclude from *one* 
post that he's one of your non-expert non-programmer programmers? Apart 
from wishful thinking, of course.



-- 
Steven D'Aprano
http://import-that.dreamwidth.org/



More information about the Python-list mailing list