On Mon, 18 Apr 2005 14:06:08 -0700, "Robert Brewer" <[EMAIL PROTECTED]> wrote:
>Reinhold Birkenfeld wrote: >> >y =3D (f(11, 22, x=3D1, y=3D'y for f') * >> > g(*args_from_somewhere, >> > x=3D'x for g', y=3D'y for g', >> > foo=3Dlambda: return 'foo for g')) >> > >> >would be my current way to express this. But still, the less lines, >> >the less confusing it is. > >And Ron Adam replied: >> I would probably do it this way. >>=20 >> y =3D f(11, 22, x=3D1, y=3D'y for f') \ >> * g( *args_from_somewhere, >> x=3D'x for g',=20 >> y=3D'y for g', >> foo=3Dlambda: return 'foo for g' ) > >Which are both prettier, until you actually try to use them: > >>>> g( *args_from_somewhere, x=3D'x for g', y=3D'y for g', foo=3Dlambda: >return 'foo for g' ) >Traceback ( File "<interactive input>", line 1 > g( *args_from_somewhere, x=3D'x for g', y=3D'y for g', foo=3Dlambda: >return 'foo for g' ) > ^ >SyntaxError: invalid syntax > > I had a bug too ;-/ No returns in lambda ;-) Other than that, it compiles, so I suspect the visual structure helped, even if not so pretty. Regards, Bengt Richter -- http://mail.python.org/mailman/listinfo/python-list