A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/039205.html below:

[Python-Dev] accumulator display syntax

[Python-Dev] accumulator display syntax [Python-Dev] accumulator display syntaxBarry Warsaw barry at python.org
Tue Oct 21 18:07:22 EDT 2003
On Tue, 2003-10-21 at 17:59, Raymond Hettinger wrote:
> [Guido]
> > I expect that most iterator comprehensions (we need a better term!)
> > are not stored in a variable but passed as an argument to something
> > that takes an iterable, e.g.
> > 
> >   sum(len(line) for line in file if line.strip())
> 
> That is somewhat beautiful.

Indeed, as is the term "generator expression" and the relegation to
syntactic sugar of list comprehensions.

> > We can quibble about whether double parentheses are needed
> 
> I vote for not requiring the outer parentheses unless there is an
> adjacent comma.

I like that too.  It mirrors other situations where the parentheses
aren't needed except to disambiguate syntax.  In the above example,
there's no ambiguity.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20031021/53953213/attachment.bin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4