I think list comprehensions feel more pythonic. The syntax fits perfectly with the rest of python. I also think it is more similar to natural languages.
Example:
dog.namefordoginanimalsifdog.type=="dog"
"Please give me the dog names for every dog from my animals (if it really is a dog)"
It is also easy to use the same syntax for dictionary comprehensions and generators. Especially generators are a useful concept. Instead of creating a new list in memory they can generate them on the fly:
I think list comprehensions feel more pythonic. The syntax fits perfectly with the rest of python. I also think it is more similar to natural languages.
Example:
"Please give me the
dog names
for everydog
from myanimals
(if it really is a dog)"It is also easy to use the same syntax for dictionary comprehensions and generators. Especially generators are a useful concept. Instead of creating a new list in memory they can generate them on the fly:
Instead of downloading the complete internet into your memory this will download the pages one by one while iterating the generator.
These are the reasons why I personally love the comprehension syntax in python.
Edit
Uhm I just noted that your comment is already a year old. Sorry for reviving an old conversation.