Of what use is 'lambda'???

Kragen Sitaker kragen at dnaco.net
Sun Sep 24 15:44:00 EDT 2000


In article <slrn8ssgdr.qb0.qrczak at qrnik.knm.org.pl>,
Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> wrote:
>Python does quite good job in the first point. The second is
>half-baked: one have to explicitly list free variables of a closure
>and lambda cannot execute explicitly listed statements.

I'm running into kind of a tough problem; there doesn't seem to be a
way to make variadic closures with lambda in Python:

	x = lambda *args, prefix='here': mp(prefix, args)

. . . is syntactically invalid, for obvious reasons.

Is there a way?
-- 
<kragen at pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Perilous to all of us are the devices of an art deeper than we ourselves
possess.
                -- Gandalf the Grey [J.R.R. Tolkien, "Lord of the Rings"]



More information about the Python-list mailing list