[Python-Dev] Re: Feature bloat in Python (was some PEP thing!)

Neil Hodgson nhodgson@bigpond.net.au
Sun, 23 Jul 2000 16:29:49 +1000

> I don't know what you are talking about. Which of these proposals
> require you to be a little brighter?
> ...

*** This one.
> j=[for k in a: if k%2: k*2] # list comprehensions

> ...
> Which proposals require too much intelligence? Which ones would you not
> be able to "sight read" coming from Java or Perl? And how do they really
> compare (for sight-reading) to the contemporary equivalents:

   Maybe I'm trapped in my past here but my "sight reading" of list
comprehensions brings back memories of BCPL which would have propagated the
result of the loop (IIRC, the last expression evaluated within the loop) as
the result of the expression. Its hardly obvious what this does based on
experience with most current languages including C++, Java or VB.

   The counter-example given for this in current Python is much more
readable to users of these languages.

   OTOH list comprehensions would be a more significant capability upgrade
than the other changes to me and is thus worthy of a larger syntax change.