Teks sumber — English
Terjemahan — Bahasa Indonesia
List Comprehensions
Daftar *List* *Comprehensions*
Because of Python's scoping rules, a default argument is used so that the anonymous function created by the :keyword:`lambda` expression knows what substring is being searched for. List comprehensions make this cleaner::
List comprehensions have the form::
The idea of list comprehensions originally comes from the functional programming language Haskell (https://www.haskell.org). Greg Ewing argued most effectively for adding them to Python and wrote the initial list comprehension patch, which was then discussed for a seemingly endless time on the python-dev mailing list and kept up-to-date by Skip Montanaro.