Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Mark Lawrence Newsgroups: comp.lang.python Subject: Re: Python keyword args can be any string Date: Thu, 18 Feb 2016 07:55:59 +0000 Lines: 21 Message-ID: References: <56c559c2$0$2916$c3e8da3$76491128@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de MI/z7yOMlG0TEoRLdmHh6AAzfEhOZ+hmCJc+F0PFv0jA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'from:addr:yahoo.co.uk': 0.05; 'kwargs': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'bug': 0.10; 'def': 0.13; "'':": 0.16; '05:42,': 0.16; '23,': 0.16; '42,': 0.16; 'feature?': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'string:': 0.16; "{'':": 0.16; 'wrote:': 0.16; 'language': 0.19; 'arguments': 0.22; 'lawrence': 0.22; 'header:In-Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'sure,': 0.29; "i'm": 0.30; 'language.': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'but': 0.36; 'keyword': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'to:addr:python.org': 0.40; 'mark': 0.40; 'charset:windows-1252': 0.62; 'our': 0.64; 'today': 0.65; 'pythonistas,': 0.84; 'subject:any': 0.84 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 80.234.182.166 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: <56c559c2$0$2916$c3e8da3$76491128@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21rc2 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:103093 On 18/02/2016 05:42, Steven D'Aprano wrote: > Today I learned that **kwargs style keyword arguments can be any string: > > py> def test(**kw): > ... print(kw) > ... > py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17} > py> test(**kwargs) > {'': 23, '123': 17, '---': 999, 'abc-def': 42} > > Bug or feature? > I'm not sure, but what on earth got you to this in the first place? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence