Closures / Blocks in Python

Cameron Laird claird at lairds.us
Wed Jul 25 15:30:47 CEST 2007


In article <1185291146.753573.280420 at n60g2000hse.googlegroups.com>,
Jason  <tenax.raccoon at gmail.com> wrote:
			.
		[good detail]
			.
			.
>If you can't find a way of doing what you want with iterators,
>comprehensions, or lambda, consider writing a little function.  Heck,
			.
			.
			.
"[C]onsider writing a little function", indeed; that's 
a crucial summary.  From a Ruby or Lisp perspective, 
this proliferation of named functions is clumsy and 
unsightly; Pythoneers see small def-s as opportunities
to clarify.  I've come to suspect both sides are right.
The marvelous thing is that, taken as a whole, each of
Python, Ruby, ... *works*, and admits a strong, effec-
tive style.  Moreover, they share enough conceptually
that it's not hard for speakers of one to understand
the others.  As has already been proposed in this 
thread, though, good Ruby and good Python will always
look different.



More information about the Python-list mailing list