Favorite non-python language trick?

Steven D'Aprano steve at REMOVETHIScyber.com.au
Sat Jun 25 22:18:29 EDT 2005


On Sat, 25 Jun 2005 23:19:48 +0200, Peter Otten wrote:

> Python is more about readability than raw speed, and I prefer a for-loop
> over reduce() in that respect, too. 

Fascinating. I prefer reduce for readability. "Reduce this list to one
value, using this known behaviour" seems to work for me better than:

"Oh look, here is a new name being defined. What is it for I wonder? Now
it is being used in a for loop. Ah, the loop appears to be implementing
the well-known reduce behaviour from Lisp. I bet that means that the name
is a temporary placeholder just being used to hold the intermediate
results of from the for loop. Yes, that seems to be the case."

Funny how people differ in what they find readable :-)


-- 
Steven.




More information about the Python-list mailing list