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

[Python-Dev] accumulator display syntax

[Python-Dev] accumulator display syntaxTim Peters tim.one at comcast.net
Tue Oct 21 16:19:33 EDT 2003
[Guido]
> I expect that most iterator comprehensions (we need a better term!)
> ...

Well, calling it an iterator Aussonderungsaxiom would continue emphasizing
the wrong thing <wink>.

"Set comprehensions" in a programming language originated with SETL, and are
named in honor of the set-theoretic Axiom of Comprehension
(Aussonderungsaxiom).  In its well-behaved form, that says roughly that
given a set X, then for any predicate P(x), there exists a subset of X whose
elements consist of exactly those elements x of X for which P(x) is true (in
its ill-behaved form, it leads directly to Russell's Paradox -- the set of
all sets that don't contain themselves).

So "comprehension" emphasizes the "if" part of list comprehension syntax,
which often isn't the most interesting thing.  More interesting more often
are (a) the computation done on the objects gotten from the for-iterator,
and (b) that the results are generated one at a time.

Put that all in a pot and stir, and the name "generator expression" seems
natural and useful to me.  In the Icon language, *all* expressions are
generators, so maybe I'm biased by that.  OTOH, "the results are generated
one at a time" is close to plain English, and "generator expression" then
brings to my mind an expression capable of delivering a sequence of results.

Or you could call it an Orlijn flourish.


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