Keyword-only arguments (Re: [Python-Dev] Efficient predicates for the
standard library)
Greg Ewing
greg at cosc.canterbury.ac.nz
Mon Oct 6 20:38:28 EDT 2003
Gareth McCaughan <gmccaughan at synaptics-uk.com>:
> >>>> def any(*iterables, pred=bool):
> >
> > ------------------------------------------------------------
> > File "<stdin>", line 1
> > def any(*iterables, pred=bool):
> > ^
> > SyntaxError: invalid syntax
>
> Aieee! I was so sure you could do that, I didn't bother
> checking
I was just thinking the other day that you *should* be
able to say that. Any keyword arguments after a * arg
would have to be specified by keyword in the call.
So many PEP ideas, so little time...
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury, | A citizen of NewZealandCorp, a |
Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. |
greg at cosc.canterbury.ac.nz +--------------------------------------+
More information about the Python-Dev
mailing list