[Python-ideas] keyword arguments everywhere (stdlib) - issue8706
Guido van Rossum
guido at python.org
Sat Mar 3 18:54:03 CET 2012
On Sat, Mar 3, 2012 at 7:20 AM, Ron Adam <ron3200 at gmail.com> wrote:
> It seems to me that sometimes the writer of functions wish to have more
> control of how the function is called, but I think it is better that the
> user of a function can select the calling form that perhaps matches the
> data and/or style they are using more closely.
Um, the function author chooses the signature. If you disagree with
that signature, tough luck.
> I hope in the future that we find ways to simplify function signatures
> in a way that make them both easier to use and more efficient for the
> function user, rather than continue adding specific little tweaks that
> give the function designer more control over how the function user calls
> it.
You seem to forget that API design is an art and that it is the
function author's prerogative to design an API that minimizes mistakes
for all users of the function. Sometimes that includes requiring that
everyone uses positional arguments for a certain situation.
Anyway, I now think that adding a built-in @positional(N) decorator
makes the most sense since it doesn't require changes to the parser.
The built-in can be implemented efficiently. This should be an easy
patch for someone who wants to contribute some C code.
--
--Guido van Rossum (python.org/~guido)
More information about the Python-ideas
mailing list