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 16:54:40 EDT 2014


On 3/27/14 11:48 AM, Chris Angelico wrote:
> On Fri, Mar 28, 2014 at 3:37 AM, Mark H Harris <harrismh777 at gmail.com> wrote:
>> For the purposes of this list, a "normal" user is a reasonably intelligent
>> college educated non "computer professional" non "computer scientist" non
>> "expert" who for the moment has an interest in leveraging computer science
>> and|or programming to solve everyday or other scientific problems (without)
>> having to first become a computer professional, computer scientist, or
>> expert.
>
> Now you have to justify: Why is this person considered normal?
>

Do not think "normal" vs. "abnormal". That would be missing the mark.

"Normal" are the folks that fall (more or less) within two standard 
deviations from the mean on a normal distribution of reasonably 
intelligent, college educated scientists, and other problem solvers, who 
have not been trained in the liberal art of programming (software 
engineering) and who have an aptitude for problem solving but for 
whatever reason (including time and interest) have not been inclined so 
far towards the practical art of coding within the giant sphere of 
computer science. Of course you eliminate from the set out-lyres and 
almost all +|- outside two standard deviations of the mean (maybe a 
little more).

The set includes most human beings on the planet. These are non computer 
language experts, non computer scientists generally, non data processing 
professionals, &c.   These folks called "normal" are comprised of 
everyone else who is smart enough to use a computer but does not have 
eons to be initiated in the fine nuances of language design nor software 
engineering.  They just want to push their problem in, and get their 
result out--- relatively quickly, with minimal hassle.

Jeane, on the list this week, is an example of this kind of person.

Yes, its possible. Dartmouth proved it (graduate students before 
computer science was invented) in 1963-1964. Gates proved it again with 
his BASICA, visual BASIC, and GWBASIC.  There has been a resurgence of 
interest in this area on tablets with Mintoris BASIC. On the PC and MAC 
with Chipmunk BASIC... and others.

I am going to give this a shot with python. I honestly believe that the 
python language can be leveraged in a minimal way (without being 
minimalist) and at the same time in a sophisticated nuanced way (without 
harming the flexibility of the language) for expert users and developers.

Some people equate developer with programmer with software engineer. 
This ought not be done, in my view. There are *many* programmers out 
there who suck at software engineering (and they are not computer 
scientists).  They also do not qualify as developers.

But they are problem solvers, and they can leverage the power of python 
in a minimal way to solve their problems (fast, efficient) in a modern 
sense. We have the web now. We use databases now. Problem solvers need 
sockets now (server side, client side) that are *easy*. Mathematica is 
too complicated. Matlab the same. My idea is to unify, simplify and give 
access to the underlying language essentials system and interpreter 
(like they did in 1964) to make things easier to pick up and go.

-------

When I started at this gig someone pointed to the O'Reilly book (about 
1590) pages) and python.org.  Give me a break!

No.  We need a quick starter subset, a tiny book, and even tinier 
tutorial, that gets people ("normal" ones) a fast boot to productive 
work, yes, with pointers into more extensive reading and experimenting.
One day, they will be at least general-users, if not super-users or 
experts. They may never be python developers and that's ok.

Philosophy by me


marcus





More information about the Python-list mailing list