[Python-3000] PEP 3102
Jim Jewett
jimjjewett at gmail.com
Wed Feb 20 02:33:48 CET 2008
On 2/18/08, Adam Olsen <rhamph at gmail.com> wrote:
> On Feb 18, 2008 1:17 PM, Arnaud Delobelle <arnodel at googlemail.com> wrote:
> > A typical use of positional-only arguments is with a function
> > def f(x, y=1, **kwargs):
> > ...
> >
> > where keyword arguments are potentially anything at all, including x
> > and y. For example: dict.update().
> I worry that dict is not just an example, it may be the *only*
> example. Does somebody have a use case that doesn't involve dict?
Some existing functions are positional only, often because they expose
underlying (positional-only) C library functions. Attemping to make a
duck-type replacement just doesn't feel as clean if the arguments are
named.
That said, I don't think it does any actual damage except for the "and
it takes arbitrary keywords" case. Even then, a reserved set (such as
__* names) is usually acceptable.
-jJ
More information about the Python-3000
mailing list