why list comprehension is called so in python?

Viewed 3051

I know python is not the first language to have list comprehension. I'm just interest in the history of the name.

I'm particularly interested in why it's called comprehension

5 Answers

The name comes from the concept of a set-comprehension

Comprehension is used here to mean complete inclusion or complete description. A set-comprehension is a (usually short) complete description of a set, not an exhaustive (and possibly infinite) enumeration.

Because it's a very comprehensive way to describe a sequence (a set in math and other languages, and a list/sequence in Python).

Related