[Python-ideas] Keyword-only arguments?

Nathaniel Smith njs at pobox.com
Wed Jun 17 21:32:07 CEST 2015

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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20150617/8a8c59b6/attachment.html>

More information about the Python-ideas mailing list