Bengt Richter wrote:
On Mon, 03 Jan 2005 18:54:06 GMT, Steven Bethard <[EMAIL PROTECTED]> wrote:


Roman Suzi wrote:

I wish lambdas will not be deprecated in Python but the key to that is
dropping the keyword (lambda). If anybody could think of a better syntax for
lambdas _with_ arguments, we could develop PEP 312 further.

Some suggestions from recent lambda threads (I only considered the ones that keep lambda as an expression):



Just for reference, am I correct in assuming these are the equivalent uses of lambda?:

 lambda a, b, c:f(a) + o(b) - o(c)
 lambda x: x * x
 lambda : x
 lambda *a, **k: x.bar(*a, **k)
 (lambda : x(*a, **k)) for x, a, k in funcs_and_args_list)

Yeah, I believe that was the intention, though I stole the examples from [1].


That last seems like it might need the default-arg-value hack: i.e.,
 (lambda x=x, a=a, k=k: x(*a, **k)) for x, a, k in funcs_and_args_list)

Good point.

Steve
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to