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/039124.html below:

[Python-Dev] Re: Re: accumulator display syntax

[Python-Dev] Re: Re: accumulator display syntax [Python-Dev] Re: Re: accumulator display syntaxAlex Martelli aleaxit at yahoo.com
Tue Oct 21 03:43:31 EDT 2003
On Tuesday 21 October 2003 09:27 am, Greg Ewing wrote:
   ...
> But maybe some other keyword could be added to ease any
> syntactic problems, such as "all" or "every":
>
>   sum(all x*x for x in xlist)
>   sum(every x*x for x in xlist)
>
> The presence of the extra keyword would then distinguish
> an iterator comprehension from the innards of a list
> comprehension.

Heh, you ARE a volcano of cool syntactic ideas these days, Greg.

As between them, to me 'all' sort of connotes 'all at once' while
'every' connotes 'one by one' (so would a third possibility, 'each');
so 'all' is the one I like least.

Besides accumulators &c we should also think of normal loops:

for a in all x*x for x in xlist: ...

for a in every x*x for x in xlist: ...

for a in each x*x for x in xlist: ...

Of these three, 'every' looks best to me, personally.


Alex


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