On 4/19/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > Here's a related but more complicated wish: define a function in such > > a way that certain parameters *must* be passed as keywords, *without* > > using *args or **kwds. This may require a new syntactic crutch. > > A single '*' could indicate that no additional positional arguments were > permitted. > > def f(*, paramA, paramB=10): > print paramA, paramB > > Here paramA and paramB can only be passed as keywords, and paramA *has* to be > passed as it has no default.
I once considered and rejected this syntax since another logical interpretation would be that any positional arguments are accepted but *ignored*. > Utterly magical to anyone not already familiar with the use of *args, though. But so would any other newly invented syntax, probably, so that doesn't count heavily. Would *None be too bizarre? -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com