Edward Loper wrote: > > One reason I see is to have keyword-only functions, i.e. with no > > positional arguments at all: > > > > def make_person(*, name, age, phone, location): > > pass > > > > which also works for methods: > > > > def make_person(self, *, name, age, phone, location): > > pass > > > > In these cases, you don't *want* name, age to be passed in a positional > > way. How else would you formulate that if this syntax wasn't available? > > But is it necessary to syntactically *enforce* that the arguments be > used as keywords? I.e., why not just document that the arguments should > be used as keyword arguments, and leave it at that.
and how do you best do that, in a way that automatic introspection tools understand, unless you invent some kind of standard syntax for it? and if you have a standard syntax for it, why not support it at the interpreter level ? </F> _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com