A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-May/064688.html below:

[Python-Dev] PEP 3102: Keyword-only arguments

[Python-Dev] PEP 3102: Keyword-only argumentsFredrik Lundh fredrik at pythonware.com
Mon May 1 15:04:01 CEST 2006
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>



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4