[Python-ideas] keyword arguments everywhere (stdlib) - issue8706

Westley Martínez anikom15 at gmail.com
Tue Mar 6 00:01:46 CET 2012


I'm -1 on this issue after some thought:

I think we need to look at this from the function user's perspective.
For example let's take this hypothetical declaration:

    def func(a, b, /, x, y, *, name, color):

This function may be called like this:

    func(v1, v2)
    func(v1, v2, v3, v4)
    func(v1, v2, y=v4, x=v3)
    func(v1, v2, x=v3, y=v4)
    func(v1, v2, v3, v4, name='westley', color='0xffffff')
    func(v1, v2, name='westley', color='0xffffff', x=v3, y=v4)
    func(v1, name='westley', color='0xffffff', x=v3, y=v4, v2)  # ERROR!

To me, this just feels a little too ... mutable.  In C we have one way
to call functions that is equal to it's function declaration.  I'd be +1
for functions that have ONLY non-keyword arguments which would be
declared via decorator:

    @positional     # This name is a bit ambiguous I guess....
    def func(a, b)



More information about the Python-ideas mailing list