Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'assign': 0.04; 'function,': 0.07; 'subject:based': 0.07; 'python': 0.08; 'args,': 0.09; 'decorator': 0.09; 'statement.': 0.09; 'syntax.': 0.09; 'def': 0.13; 'received:209.85.210.174': 0.13; 'received:mail- iy0-f174.google.com': 0.13; 'useful,': 0.15; '"normal"': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'head,': 0.16; 'sequence,': 0.16; 'subject: \n ': 0.16; 'subject:syntax': 0.16; 'examples': 0.16; 'wrote:': 0.18; 'maybe': 0.21; 'dec': 0.22; 'header:In-Reply-To:1': 0.22; 'handles': 0.25; 'message-id:@mail.gmail.com': 0.28; 'pass': 0.29; 'indicated': 0.29; 'looks': 0.29; 'second': 0.29; 'pm,': 0.29; 'sun,': 0.30; 'tail': 0.30; 'quite': 0.32; 'does': 0.32; 'to:addr:python-list': 0.34; 'fundamental': 0.34; 'rest': 0.35; 'subject:/': 0.35; 'none': 0.37; 'element': 0.37; 'sequence': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'same.': 0.39; "it's": 0.40; 'received:209': 0.40; 'to:addr:python.org': 0.40; 'might': 0.40; '2011': 0.61; 'back': 0.62; 'perfect': 0.64; 'size.': 0.71; 'buck': 0.84; 'concept,': 0.84; 'insufficient': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=brXiLf1mPrTDet1ysb9N6m2MeU0eWrYRgJmQgFwC0Og=; b=uZ0YN3WMPRb6D5E7rbYijV3hhM98EalMrKyfMYqRzk0Ce7yYl0t5oB3Iws8gRr2wTE aspVyQ/HYuPLDVsKMJ6bgkYPBB4rcaxPRoG4xfNgBg4Pr9jd4+19XST/ApU9xz3ODT/W b5j0qz5TsJHHWW4ILwm4yFeH9Skh/2IcxsPaA= MIME-Version: 1.0 In-Reply-To: <15424060.724.1324183952802.JavaMail.geo-discussion-forums@prix23> References: <841f4d29-f50b-4b0b-912b-b497fb6e60ec@t16g2000vba.googlegroups.com> <15424060.724.1324183952802.JavaMail.geo-discussion-forums@prix23> Date: Sun, 18 Dec 2011 16:21:00 +1100 Subject: Re: Pythonification of the asterisk-based collection packing/unpacking syntax From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324185663 news.xs4all.nl 6864 [2001:888:2000:d::a6]:35655 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17436 On Sun, Dec 18, 2011 at 3:52 PM, buck wrote: > The last one looks decorator-ish, but maybe that's proper. The implementa= tion of this would be quite decorator-like: take the "normal" value of x, p= ass it through the indicated function, assign that value back to x. > > Try these on for size. > > =A0 =A0 head, @tuple tail =3D sequence > =A0 =A0 def foo(@list args, @dict kwargs): pass > =A0 =A0 foo(@args, @kwargs) That's reasonably clean as a concept, but it's not really quite the same. None of these examples is the way a decorator works; each of them requires a fundamental change to the way Python handles the rest of the statement. head, @tuple tail =3D sequence -- Does this mean "take the second element of a two-element sequence, pass it through tuple(), and store the result in tail"? Because, while that might be useful, and would make perfect sense as a decorator, it's insufficient as a replacement for current "*tail" syntax. ChrisA