I sing the praises of lambda, my friend and savior!
Clark C. Evans
cce at clarkevans.com
Tue Oct 12 12:28:31 EDT 2004
On Tue, Oct 12, 2004 at 08:19:55AM +0000, Antoon Pardon wrote:
| Op 2004-10-11, Jeff Shannon schreef <jeff at ccvcorp.com>:
| > gabriele renzi wrote:
| >> then what you want is a better lambda. One where you can use return,
| >> maybe, and where you can have statements and multiple expressions.
| >> Don't throw away the baby with the bathwater.
| >
| > But because of Python's line- and indentation-based syntax, doing all of
| > that on a single line is... um... awkward at best, to put it mildly.
|
| Which is one of the reasons I think the indentation-based syntax was
| a mistake. If the syntax becomes an argument against a construct
| in the language, something is wrong with the syntax IMO.
Indentation based structure is a godsend; a divine insight if you may.
Python is much much better for it. However, just beacuse it can use
indentation, doesn't mean that indentation should be mandated for every
case. Python uses {} and [] to scope dict and list items, but this does
not mean that a indentation based version of this wouldn't be welcome.
In general, indentation is great for "outer-structure" that is,
delimiting large code blocks. While delimiter based scoping is good
for inner structures, small blocks of code. It should not be an
either/or thing, one should properly have the option of using either
option depending upon which style brings the most clarity.
Cheers,
Clark
More information about the Python-list
mailing list