Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!zen.net.uk!dedekind.zen.co.uk!tudelft.nl!txtfeed1.tudelft.nl!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'arguments': 0.05; 'received:edu.au': 0.07; 'subject:method': 0.09; 'syntax': 0.11; 'wrote:': 0.15; '(note:': 0.16; 'ambiguous': 0.16; 'blah': 0.16; 'examples.': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:202.125.174': 0.16; 'received:202.125.174.133': 0.16; 'received:boardofstudies.nsw.edu.au': 0.16; 'received:cskk.homeip.net': 0.16; 'received:harvey.boardofstudies.nsw.edu.au': 0.16; 'received:homeip.net': 0.16; 'received:nsw.edu.au': 0.16; 'subject:function': 0.16; 'subject:syntax': 0.16; 'type:': 0.16; 'underscores,': 0.16; 'cc:addr:python-list': 0.16; 'def': 0.16; '(i.e.': 0.17; 'cheers,': 0.19; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'interpreted': 0.23; 'keyword': 0.25; 'later': 0.26; 'function': 0.26; 'paul': 0.28; 'problem': 0.29; 'cc:addr:python.org': 0.30; 'construct': 0.30; 'error': 0.31; 'break': 0.33; 'rather': 0.33; 'instead': 0.34; 'header:User-Agent:1': 0.34; 'there': 0.34; "can't": 0.34; 'subject:/': 0.36; 'idea': 0.36; 'error.': 0.36; 'received:au': 0.36; 'but': 0.37; 'could': 0.37; 'another': 0.38; 'subject:: ': 0.38; 'skip:\xce 10': 0.38; 'difficult': 0.39; 'help': 0.39; 'under': 0.39; 'might': 0.39; 'called': 0.40; 'your': 0.60; 'easily': 0.61; 'order': 0.62; '8bit%:23': 0.62; 'immediate': 0.65; 'received:202': 0.66; 'cameron': 0.67; '8bit%:100': 0.70; 'imagine': 0.71; 'skip:\xe2 10': 0.71; 'hybrid': 0.84; 'inclusion': 0.84; 'misuse': 0.91 Date: Mon, 18 Jul 2011 12:04:24 +1000 From: Cameron Simpson To: =?utf-8?B?zqTOls6pzqTOls6Zzp/OpSA8dHpvdHppb3lAZ21haWwuY29tPg==?=@cskk.homeip.net Subject: Re: Crazy what-if idea for function/method calling syntax MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) References: Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310954676 news.xs4all.nl 23854 [2001:888:2000:d::a6]:54928 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9775 On 17Jul2011 15:54, ΤΖΩΤΖΙΟΥ wrote: | What if a construct | | xx(*args1, **kwargs1)yy(*args2, **kwargs2) | | was interpreted as | | xxyy(*(args1+args2), **(kwargs1+kwargs2)) | | (Note: with **(kwargs1+kwargs2) I mean “put keyword arguments in the | order given”, since dicts can't be added) | | This construct is currently a syntax error. The intent of this idea is | to help improve legibility. | | Example: | def place_at(item, x, y): blah blah | could be called as | place(item)_at(x, y) [...] | There is also a big window for misuse (i.e. break the function/method | name in illogical places), but I would classify this under “consenting | adults”. It might be suggested as good form that function names break | at underscores, like my examples. Another problem is the scope for error. I can easily imagine typing: x=foo(x)bah(y) when I intended to type: x=foo(x)+bah(y) Adding your syntax causes silent breakage later instead of immediate syntax error now. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ hybrid rather than pure; compromising rather than clean; distorted rather than straightforward; ambiguous rather than articulated; both-and rather than either-or; the difficult unity of inclusion rather than the easy unity of exclusion. - Paul Barton-Davis