On Sat, 18 Oct 2008 21:34:13 -0700, Kay Schluehr wrote: > On 18 Okt., 22:01, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > >> Perhaps it also omitted the fact that nothing prevents you from >> defining a function to write things to stdout (or elsewhere) in Python >> 2.5, making the Python 3.x change largely a non-feature. ;) >> >> Jean-Paul > > Even more. If someone had solved the hard problem of finding a less > cumbersome way of writing sys.stdout.write(...) the request for > multiline lambdas ( multi expression lambdas actually ) could have been > decreased about 75-80%.
Er, am I missing something? How about this? import sys pr = sys.stdout.write pr('Is this less cumbersome enough for you?') But of course, that doesn't really help you avoid multi-expression lambdas, unless you want to write obfuscated code: def foo(x): y = x+1 print y return y is roughly, but inefficiently, equivalent to: lambda x: sys.stdout.write(x+1) or x+1 But that's cumbersome and obfuscated, and not scalable at all. -- Steven -- http://mail.python.org/mailman/listinfo/python-list