[Python-3000] parameter lists [was: Type Expressions]

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Apr 21 02:48:33 CEST 2006


Jim Jewett wrote:
> I also see the value of keyword-only arguments without unlimited
> positional arguments. Whether it deserves syntax and what that syntax
> should be (such as * or *None) may need a pronouncement eventually,
> but it doesn't have to be complex.

My previous post was just wild brainstorming. I'd be
perfectly happy with
 def f(a, b, *, c, d = x):
 # c and d are keyword only, c is required,
 # no extra positional args allowed
I don't buy the argument that bare * should mean "extra
positional args ignored", since there's already a way of
saying that:
 def f(a, b, *others):
 # and then don't bother doing anything with others
As shown above, I don't see any extra difficulty there.
--
Greg


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /