Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.glorb.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; ':-)': 0.06; 'subject:method': 0.09; 'syntax': 0.11; '(note:': 0.16; '(x,': 0.16; 'blah': 0.16; 'jumping': 0.16; 'subject:function': 0.16; 'subject:syntax': 0.16; 'cc:addr:python- list': 0.16; 'def': 0.16; 'cc:2**0': 0.21; 'cc:no real name:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'interpreted': 0.23; 'charset:iso-8859-7': 0.25; 'in:': 0.25; 'keyword': 0.25; 'pass': 0.28; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.30; 'construct': 0.30; 'class': 0.31; 'required.': 0.31; 'changes': 0.31; "can't": 0.34; 'subject:/': 0.36; 'idea': 0.36; 'error.': 0.36; 'could': 0.37; 'received:google.com': 0.38; 'received:209.85.161': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.38; 'help': 0.39; 'received:209': 0.40; 'called': 0.40; 'order': 0.62; '"put': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=VAOLUt0ffFnXs4c9KcbmqhHWnwS/h4gYxoU4wBu9j8w=; b=iyI413eXf/HAuva5wIqT1KNohJTmHU817jIjoWLJggU7noNmUhYC0R3Ne4ZmVoVNZr eSK7FGQHb8GmomRcbo1FGOqQ8oNPiEFe7OPbz2gRd4q0szz2rUR7A9hRbHbHSOOS3Gtq WiQmNWtpHUIPfOpE1Lr4LvumKvlmMde2dfySs= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Sun, 17 Jul 2011 21:29:45 -0600 Subject: Re: Crazy what-if idea for function/method calling syntax To: =?ISO-8859-7?B?1MbZ1MbJz9U=?= Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1310959816 news.xs4all.nl 23852 [2001:888:2000:d::a6]:42573 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:9777 2011/7/17 =D4=C6=D9=D4=C6=C9=CF=D5 : > Jumping in: > > 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) class place(object): def __init__(self, item): self.__item =3D item def at(self, x, y): # place self.__item at (x, y) pass Then you can do: place(item).at(x, y) No syntax changes required. :-)