[Python-ideas] Keyword-only arguments?

Joseph Jevnik joejev at gmail.com
Wed Jun 17 21:36:45 CEST 2015


> In retrospect I wish this had been backported to 2.7, because they're
super useful for making better APIs, but that ship has sailed

Why would this not be able to be ported now? It does not clash with any
existing python 2 syntax so all current python 2 is still valid and has no
behaviour change.

On Wed, Jun 17, 2015 at 3:32 PM, Nathaniel Smith <njs at pobox.com> wrote:

> On Jun 17, 2015 12:11 PM, "Amber Yust" <amber.yust at gmail.com> wrote:
> >
> > Interesting. I don't think I've ever seen it used, even having looked at
> Python 3 code. For those who have worked with more Python 3 code than I
> have, do you ever see it used?
>
> Unfortunately, no, because at this point almost all py3 APIs I see are
> still aiming for py2/py3 compatibility, and there's really no good way to
> accomplish kw only args in py2. It can be done, but it's very cumbersome;
> not like range or print or whatever where you can just import something
> from six or add some parentheses.
>
> In retrospect I wish this had been backported to 2.7, because they're
> super useful for making better APIs, but that ship has sailed.
>
> -n
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150617/e9d243a3/attachment.html>


More information about the Python-ideas mailing list