Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)
Mark H Harris
harrismh777 at gmail.com
Thu Mar 27 23:14:09 CET 2014
On 3/27/14 4:42 PM, Chris Angelico wrote:
> And this is the bit where, I think, we disagree. I think that
> programming is for programmers, in the same way that music is for
> musicians and the giving of legal advice is for lawyers. Yes, there
> are armchair lawyers, and plenty of people can pick up a hymn book and
> but laws and operas aren't designed with them in mind. Why
> should programming languages be designed for the people who don't want
> to learn them?
Actually we agree quite a bit on this--I agree with everything above the
line----- and some of the sentiment with everything below the line.
Your question has a somewhat false premise. They *really do* want to
learn them, and they are frustrated with the time and attention it
takes. The argument is also from analogy, which in this case is almost
similar but not quite.
Now, there is no royal road to geometry, opera, the violin, and the
piano (I'm a pianist, and flutist--and an amateur composer). All of
these fine arts take time, there is just no getting around it. However,
there are now "computer based" piano courses that speed the process
(with 44 key keyboard) by factors of 10. In other words, its easier now
because of computers, to learn to play the piano on ones own time than
ever before. To be really good at it, you're going to need to get a good
instructor and work. Opera, the violin, pole vaulting, are all in
another category requiring talent! ... not just will, and brains.
Here in the states we file a little thing on or around April 15 called a
tax return. Well most of us these days file electronically, and most of
us doing that use some kind of tax software that takes in all the data,
organizes it, and gives it to the Internal Revenue Service in a format
that is legal, is accurate, and leads to no audit; because its just
right. That is more of what I'm talking about. I have no interest in
becoming a tax accountant, nor making money doing taxes for others, but,
I do want to submit my correct return on time with no errors, and from
my own keyboard (fast, efficient, error free, and with no driving,
stamping, mailing, &c).
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. 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.
Python IMHO is the perfect language to give this a shot with---
powerful, elegant, easy once initiated, fast, and most important
extensible and flexible.
"normal" people deserve this. Well, I'll know if nobody buys the book,
nor downloads the package, nor submits bug reports. But, I've got an
inkling that there is a need, all over the place.
Just look on the list: Fred Sells meta language request. He proves my
point entirely. I have not responded yet... thought I would wait a
bit... but look what he is after. Go read it.
But, I don't disagree with you Chris, and I have myself some of the same
concerns really. I'm finding the path harder than I thought it would be.
Well, its hard enough just getting other people who are experts to buy
into it. Its going to be an uphill climb, for sure.
More information about the Python-list