my favorite line of py code so far

Chris Angelico rosuav at gmail.com
Sat Nov 9 04:28:28 EST 2013


On Sat, Nov 9, 2013 at 8:23 PM, Peter Cacioppi <peter.cacioppi at gmail.com> wrote:
> I sometimes use map, sometimes comprehensions. I suspect other people do the same, that's why the language supports map and comprehensions.

I think map is fine if you can use a named function, but if you can't
come up with a descriptive name for what you're doing, a comprehension
is probably better (as it'll have the code right there). Mapping _
across everything tells you nothing about what it's actually doing.

ChrisA



More information about the Python-list mailing list