473,414 Members | 1,627 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

etymology of "list comprehension"?

mh
I googled and wiki'ed, but couldn't find a concise clear answer
as to how python "list comprehensions" got their name.

Who picked the name? What was the direct inspiration, another
language? What language was the first to have such a construct?

I get that it's based on set notation.

Thanks!
Mark

--
Mark Harrison
Pixar Animation Studios
Nov 6 '08 #1
6 2430
On Thu, Nov 6, 2008 at 1:19 PM, <mh@pixar.comwrote:
I googled and wiki'ed, but couldn't find a concise clear answer
as to how python "list comprehensions" got their name.

Who picked the name? What was the direct inspiration, another
language? What language was the first to have such a construct?
According to Wikipedia, the SETL programming language was the first
one to have such a construct. My understanding is that Python took the
idea from Haskell, where the concept has the same name. The term
"comprehension" for the concept was first used in the NPL programming
language (Wikipedia again).

Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
>
I get that it's based on set notation.

Thanks!
Mark

--
Mark Harrison
Pixar Animation Studios
--
http://mail.python.org/mailman/listinfo/python-list
Nov 6 '08 #2
mh
Chris Rebert <cl*@rebertia.comwrote:
the term
"comprehension" for the concept was first used in the NPL programming
language (Wikipedia again).
Ah, thanks... and does "comprehension" have any special computer
science meaning?

--
Mark Harrison
Pixar Animation Studios
Nov 6 '08 #3
mh@pixar.com wrote:
I googled and wiki'ed, but couldn't find a concise clear answer
as to how python "list comprehensions" got their name.

Who picked the name? What was the direct inspiration, another
language? What language was the first to have such a construct?

I get that it's based on set notation.
The etymology of 'com-prehend' is with-grab, where prehend comes from
the same Latin verb as prehensile (able to grab). A set comprehension
(which has also been called things like 'set-builder notation') includes
or grabs the whole set in one expression, instead of listing members
one-by-one.

tjr

Nov 7 '08 #4
On 6 Nov, 22:13, m...@pixar.com wrote:
Chris Rebert <c...@rebertia.comwrote:
the term
"comprehension" for the concept was first used in the NPL programming
language (Wikipedia again).

Ah, thanks... and does "comprehension" have any special computer
science meaning?
Good question. It seems that comprehension in this case relates to
comprehensiveness - i.e. a note of how complete a set is. From the
list at

http://www.onelook.com/?w=comprehension&ls=a

check out in particular Merriam-Webster meanings 2a and 2b, and
Wikipedia for comprehension (logic).

--
HTH,
James
Nov 7 '08 #5
mh@pixar.com wrote:
Chris Rebert <cl*@rebertia.comwrote:
>the term
"comprehension" for the concept was first used in the NPL programming
language (Wikipedia again).

Ah, thanks... and does "comprehension" have any special computer
science meaning?
Paul already explained the maths, but I find that the etymology remains
unclear still. In any case, the Wikipedia article
Axiom_schema_of_specification says that the following names are used
for this axiom:
- axiom schema of specification,
- axiom schema of separation,
- subset axiom scheme or
- axiom schema of restricted comprehension

I think the "comprehension" definition goes back to this definition from
logic:

# In logic, the comprehension of an object is the totality of
# intensions, that is, attributes, characters, marks, properties, or
# qualities, that the object possesses, or else the totality of
# intensions that are pertinent to the context of a given discussion.

So you get an "intensional" definition of a set: give me all object
with a certain comprehension - as opposed to "extensional" definition,
such as "the set of all capitals consists of Paris, London, Berlin,
Madrid, ..."

The definition in logic, in turn, matches my understanding of the
English word "to comprehend": If I know all attributes, marks,
etc of an object, I understand it fully, i.e. I comprehend it.

Regards,
Martin
Nov 7 '08 #6
mh
"Martin v. Lowis" <ma****@v.loewis.dewrote:
The definition in logic, in turn, matches my understanding of the
English word "to comprehend": If I know all attributes, marks,
etc of an object, I understand it fully, i.e. I comprehend it.
I think also that as was pointed out, "comprehension" meaning
"comprehensive" also makes sense, e.g.

a comprehensive definition of positive odd numbers:

{ x | x = 2k+1, for all integers k >= 0 }

as opposed to

{ 1, 3, 5, ... }
Thanks everybody, I feel much better informed now!

--
Mark Harrison
Pixar Animation Studios
Nov 7 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Nicolas Girard | last post by:
Hi, Forgive me if the answer is trivial, but could you tell me how to achieve the following: {k1:,k2:v3,...} --> ,,,...] The subtle point (at least to me) is to "flatten" values that are...
17
by: Istvan Albert | last post by:
Paul McGuire wrote: > Please reconsider the "def f() :" construct. Instead of > invoking a special punctuation character, it uses context and placement, > with familiar old 's, to infuse the...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
3
by: Alessandro Brollo | last post by:
Far from a professional programmer, I'm simply a newbie Python user. Two basic questions: 1. I don't want to post banal questions about Python to main Python list. Does a "banal Python questions...
5
by: Konrad L. M. Rudolph | last post by:
I hope this is the right NG, please notify me if not. I have got a problem with the "recent files" list of the start page in VS.NET: yesterday I created a new projekt which has the same name as...
2
by: thomasfj | last post by:
Hi, Accroding to MS documentation the use of union and list elements in XSD simpleType (valid according to W3C standards) is valid used as an dataset schema...but it's not!! When loading the...
3
by: janzon | last post by:
Hi! Sorry for the bad subject line... Here's what I mean. Suppose we deal with C++ standard integers lists (the type is indifferent). We have a function f, declared as list<intf(int); Now...
4
by: zacks | last post by:
Most applications whose purpose is to work with various types of files implement a "Most Recent Files" list, where the last, say, four files accessed by the application can quickly be re-opened by...
0
by: howkoss | last post by:
Hi, I've been very frustrated for 2 days trying to make this work. I started with a built-in template "Projects" that came with Access 2007. On the "Employee List" I can click on any cell and bring...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.