DEV Community

Discussion on: Understanding map, filter, and zip in Python

Collapse
 
rhymes profile image
rhymes • Edited

I almost never use map or filter but it's good to know how they work. I use list comprehensions all the time though.

A tip: you don't need to call list() on an iterable, unless you have a good reason to (like to print it as an example) you can just... iterate it :)

This is a good intro on "functional Python": Functional Programming HOWTO

Collapse
 
codespent profile image
Patrick Hanford

I predominantly use comprehensions as well, I actually completely forgot you could just iterate the objects so good call! I'm going to update this.