[Python-ideas] About calling syntax

Bruce Leban bruce at leapyear.org
Wed Sep 10 17:24:12 CEST 2008


On Tue, Sep 9, 2008 at 11:22 PM, Zaur Shibzoukhov <szport at gmail.com> wrote:

> 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.
>

But why should you be forced to separate them like that. Why not

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

I'm sure there are scenarios where this is useful but I think in general it
would be less readable. As it is, I can't miss a positional argument in the
middle of a long list of keyword arguments:

foo(a=b,c=d,e=f,g=h,i=j,k=l,m)

--- Bruce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20080910/748471d2/attachment.html>


More information about the Python-ideas mailing list