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 "numeric_owner=True" would be a better usage.
Boolean parameters are the classic problem that keyword-only parameters solve. It forces the caller to provide context for the parameter, solving the mystery-meat API problem of
tarfile.extractall(".", None, True) 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 definition I've heard for the word "pythonic" is "code like Guido writes".
//arry/
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com