Skip to content

Commit d0bb90e

Browse files
author
cclauss
committed
Python2 supports the three types of comprehensions
https://docs.python.org/2/tutorial/datastructures.html#list-comprehensions is Python 2 documentation that shows all three in action.
1 parent 9b9f20a commit d0bb90e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

comprehensions.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@ Comprehensions
33

44
Comprehensions are a feature of Python which I would really miss if I
55
ever have to leave it. Comprehensions are constructs that allow
6-
sequences to be built from other sequences. There are three type of
7-
comprehensions in Python:
6+
sequences to be built from other sequences. Three types of
7+
comprehensions are supported in both Python 2 and Python 3:
88

99
- list comprehensions
1010
- dictionary comprehensions
1111
- set comprehensions
1212

13-
list comprehensions were introduced in Python 2. set and
14-
dictionary comprehensions became a part of Python in version 3.0.
15-
1613
We will discuss them one by one. Once you get the hang of using ``list``
1714
comprehensions then you can use anyone of them easily.
1815

0 commit comments

Comments
 (0)