ABSTRACT

This chapter describes comprehensions, which are a concise way to use an existing sequence of values to create a new sequence. Python has list, set, dictionary, and generator comprehensions; Scala has a single type of comprehension, based on for expressions; and Java does not have comprehensions.