On Thu, 23 Dec 2004 10:19:33 -0600, Skip Montanaro <[EMAIL PROTECTED]> wrote: > > >> readability. Pythonic lambdas are just syntactic sugar in practice, > > Paul> Actually it's the other way around: it's named functions that are > Paul> the syntactic sugar. > > While I'm sure it can be done, I'd hate to see a non-trivial Python program > written with lambda instead of def.
What, like this? (lambda r,p,b:(r.listenTCP(6665,(type('F',(p.Factory,object),{'protocol':(type('P',(b.LineReceiver,object),{'connectionMade':lambda s:s.factory.c.append(s),'lineReceived':lambda s,m:(s.factory.m(m),None)[1]})),'c':[],'m':lambda s,m:[c.sendLine(m)for c in s.c]}))()),r.run()))(*(lambda p,i:(i(p,'reactor'),i(p,'protocol'),i('twisted.protocols.','basic')))('twisted.internet.',lambda a,b:__import__(a+b,None,None,b))) OTOH, maybe that's still trivial, it's only a multiuser network chat server, after all. plumbing-the-depths-ly, Jp -- http://mail.python.org/mailman/listinfo/python-list