[Python-Dev] Re: accumulator display syntax

Terry Reedy tjreedy at udel.edu
Fri Oct 17 14:06:28 EDT 2003


"Phillip J. Eby" <pje at telecommunity.com> wrote in message
news:5.1.0.14.0.20031017115726.0398c210 at mail.telecommunity.com...
> At 09:53 AM 10/17/03 +0200, Alex Martelli wrote:
> >What, if anything, is "very confusing" in, e.g.,
> >     sum[x*x for x in blaap]

To me, it both *looks* a lot like a Lisp macro ...

> >compared with e.g. the currently accepted:
> >     a['tanto':'va':'la', 'gatta':'al':'lardo']

(this does use ':' and ',', at least)

> Because it's arguably bad coding style to use slices or indexes on
an
> object in order to perform a function on the indexes supplied.

and acts like a Lisp macro in plugging code pieces into a template
that leads to surprising behavior, given the original form.

> I shudder to think of trying to have to explain Top(10)[...] to a
Python
> newbie, even if they're an experienced programmer.

Ditto.  Getting the reductive functionality thru a gencomp would be
better.

Terry J. Reedy






More information about the Python-Dev mailing list