On Mon, 18 Apr 2005 14:06:08 -0700, "Robert Brewer" <[EMAIL PROTECTED]> wrote:
>Reinhold Birkenfeld wrote: >> >y = (f(11, 22, x=1, y='y for f') * >> > g(*args_from_somewhere, >> > x='x for g', y='y for g', >> > foo=lambda: 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. >> >> y = f(11, 22, x=1, y='y for f') \ >> * g( *args_from_somewhere, >> x='x for g', >> y='y for g', >> foo=lambda: return 'foo for g' ) > >Which are both prettier, until you actually try to use them: > >>>> g( *args_from_somewhere, x='x for g', y='y for g', foo=lambda: >return 'foo for g' ) >Traceback ( File "<interactive input>", line 1 > g( *args_from_somewhere, x='x for g', y='y for g', foo=lambda: >return 'foo for g' ) > ^ >SyntaxError: invalid syntax > I didn't test that particular part.. but this should work. It wasn't the fault of the formatting. ;-) def f(a,b,x=None,y=None): return 1 def g( args,x=None,y=None,foo=None): return 1 args_from_somewhere = (23,24) y = f(11, 22, x=1, y='y for f') \ * g( args_from_somewhere, x='x for g', y='y for g', foo=lambda foo: 'foo for g' ) print y 1 > >Robert Brewer >MIS >Amor Ministries >[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list