[Python-ideas] Short form for keyword arguments and dicts
Ethan Furman
ethan at stoneleaf.us
Wed Jun 26 00:22:26 CEST 2013
On 06/24/2013 06:22 PM, MRAB wrote:
>
> Why not just add a single marker followed by the names, something like this:
>
> return get_special_url(special='appdir', =, per_user, for_domain, create)
Interesting idea. Similar to using the '*' to only allow keyword arguments.
Rather than having '*' in the `def` and '=' at the call-site, why not use the '*' in both places? Then it would mean
'only keyword-arguments allowed' and 'these names are the keyword arguments'. Because the variable names are the same
as the keyword names we're not losing anything.
--
~Ethan~
More information about the Python-ideas
mailing list