Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Alexander Walters
Lacking anything anyone else says... the use case for keyword only arguments (where they actually make the code better rather than simply being different) is rather limited. On 4/14/2015 13:40, Eric V. Smith wrote: I'm working on adding a numeric_owner parameter to some tarfile methods

[Python-Dev] Keyword-only parameters

2015-04-14 Thread Eric V. Smith
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

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Andrew Svetlov
At least asyncio uses keyword-only intensively. On Tue, Apr 14, 2015 at 1:40 PM, Eric V. Smith e...@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

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Paul Sokolovsky
Hello, On Tue, 14 Apr 2015 13:40:40 -0400 Eric V. Smith e...@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

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Eric V. Smith
On 04/14/2015 02:11 PM, Zachary Ware wrote: On Tue, Apr 14, 2015 at 1:06 PM, Steven D'Aprano st...@pearwood.info wrote: On Tue, Apr 14, 2015 at 01:40:40PM -0400, Eric V. Smith wrote: But, I don't see a lot of keyword-only parameters being added to stdlib code. Is there some position we've

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Ethan Furman
On 04/14, Eric V. Smith wrote: 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. os.path and

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Paul Sokolovsky
Hello, On Tue, 14 Apr 2015 15:40:32 -0400 Larry Hastings la...@hastings.org wrote: On 04/14/2015 01:56 PM, Paul Sokolovsky wrote: But newer parts of stdlib, e.g. asyncio, visibly overuse kw-only args. Overuse? asyncio? You mean that thing Guido just wrote last year? The most practical

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Larry Hastings
On 04/14/2015 01:40 PM, Eric V. Smith 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

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Glenn Linderman
On 4/14/2015 2:14 PM, Guido van Rossum wrote: Also, why do you think we added the 'lone star' syntax? :-) Hint: Not because Guido is from Texas ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Gregory P. Smith
On Tue, Apr 14, 2015 at 1:56 PM Alexander Walters tritium-l...@sdamon.com wrote: Lacking anything anyone else says... the use case for keyword only arguments (where they actually make the code better rather than simply being different) is rather limited. I disagree. For parameters not often

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Guido van Rossum
Also, why do you think we added the 'lone star' syntax? :-) -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Steven D'Aprano
On Tue, Apr 14, 2015 at 01:40:40PM -0400, Eric V. Smith wrote: 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

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Zachary Ware
On Tue, Apr 14, 2015 at 1:06 PM, Steven D'Aprano st...@pearwood.info wrote: On Tue, Apr 14, 2015 at 01:40:40PM -0400, Eric V. Smith wrote: 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

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Joe Jevnik
I personally find that keyword only arguments make for nicer APIS. It also makes subclassing easier because you are free to add new positional arguments later. Especially for boolean arguments, I think keyword only is a great API choice. On Tue, Apr 14, 2015 at 2:06 PM, Steven D'Aprano

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Łukasz Langa
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,