[Python-ideas] About calling syntax

Zaur Shibzoukhov szport at gmail.com
Wed Sep 10 08:22:43 CEST 2008

Talin wrote:
>However, to address the OP's question, do this instead:
>foo = \
>    Foo(x=1, y=2)(
>       Foo(x=4, y=5)(
>          Foo(x=3,y=4)(),
>          Foo(x=5,y=6)())
>       )
>    )

I use this form in my real coding.

Georg Brandl wrote:

> However, exchanging poisitional and keyword arguments is not in the scope of
> the PEP, and isn't likely to have any future at all -- it's just too ambiguous
> when the called object has named arguments instead of a catch-all *args in
> its signature.
More precisely I asked about the following thing.


def foo(*args, **kw): ...


in call: foo(x=2,y=3, a,b,c)
        args = [a,b,c] and kw = {'x':2, 'y':3}

in call: foo(a,b,c, x=2, y=3)
        args = [a,b,c] and kw = {'x':2, 'y':3} too.

It's just simmetrical form of calling syntax.

Best regards,

More information about the Python-ideas mailing list