This morning's Google search was, therefore:
Python "List Comprehension" advantages
which turned up this:
He mentions performance (as well as parallelization):
Simple for loops implemented in python are handled by the interpreter, and are slow. List comprehensions and map() have a in-built, fast, internal C implementation which does away with the overhead of the for loop.
Good to know about, but mildly ironic in that it leads back to C code for performance. The 70's meet the 00's.
No comments:
Post a Comment