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

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Mar 5 22:35:13 CET 2012


Steven D'Aprano wrote:

> Now that I understand that / will only appear in at most one place, like 
> * (and not following each and every positional-only arg) this is the 
> nicest syntax I've seen yet.

It's reasonably nice, but I'm not sure about giving the '/' its
own slot with commas either side. This works for * and ** because
they (optionally now in the case of *) take a name after them,
but the '/' never will.

So how about treating '/' as a separator instead:

   def foo(pos1, pos2 / arg3, arg4, *args, **kwds):

-- 
Greg



More information about the Python-ideas mailing list