[Python-Dev] Keyword-only parameters
Łukasz Langa
lukasz at langa.pl
Tue Apr 14 20:34:23 CEST 2015
If you’re introducing a new parameter that is a boolean, making it kw-only is generally accepted. Some people (myself included) would encourage you to do so.
Besides asyncio, there are already new arguments that are kw-only in many modules, including configparser, unittest, xml.etree, xmlrpc, urllib.request, traceback, tarfile, shutil, ssl, etc.
> On Apr 14, 2015, at 1:40 PM, Eric V. Smith <eric at trueblade.com> wrote:
>
> I'm working on adding a numeric_owner parameter to some tarfile methods
> (http://bugs.python.org/issue23193),
>
> In a review, Berker suggested making the parameter keyword-only. I agree
> that you'd likely never want to pass just "True", but that
> "numeric_owner=True" would be a better usage.
>
> But, I don't see a lot of keyword-only parameters being added to stdlib
> code. Is there some position we've taken on this? Barring someone saying
> "stdlib APIs shouldn't contain keyword-only params", I'm inclined to
> make numeric_owner keyword-only.
>
> Is there anything stopping me from making it keyword-only?
>
> Thanks.
> Eric.
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/lukasz%40langa.pl
More information about the Python-Dev
mailing list