[Tutor] What is "in-line code"?

Dick Moores rdm at rcblue.com
Sat Aug 14 11:29:54 CEST 2004


I've been trying to read Guido van Rossum's essay, "Python Patterns - An 
Optimization Anecdote" 
(<http://www.python.org/doc/essays/list2str.html>). There are many things 
I don't understand in it, but I'll ask about only one. What is "in-line 
code"? It appears in the Conclusion section, in "Try to use map(), 
filter() or reduce() to replace an explicit for loop, but only if you can 
use a built-in function: map with a built-in function beats for loop, but 
a for loop with in-line code beats map with a lambda function!"

Also, "in-lining" is mentioned in "Avoid calling functions written in 
Python in your inner loop. This includes lambdas. In-lining the inner 
loop can save a lot of time."

Thanks, tutors.

Dick Moores

  



More information about the Tutor mailing list