4 ms·
Map and filter, of course; less syntactical noise, simple function semantics, and plenty of precedent and equivalents in all other languages.
by lolpep8 12y ago
Map and filter, of course; less syntactical noise, simple function semantics, and plenty of precedent and equivalents in all other languages.
- bluecalm 12y agoIt's not like list comprehensions lack equivalent in other languages. Let's take Haskell for example. Python lists comprehension could use a where clause from Haskell though so one could really pack everything into a one-liner :) (as it is now, list comprehensions requiring various references to result of a function call evaluate the function each time it's used)