Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Parens do create a tuple Date: Mon, 11 Apr 2016 13:02:21 +1000 Lines: 21 Message-ID: References: <1460333911.3449208.574628345.4B46CD32@webmail.messagingengine.com> <85r3ed2ctn.fsf_-_@benfinney.id.au> <85inzp2c93.fsf@benfinney.id.au> <857fg43orj.fsf@benfinney.id.au> <570b0ca9$0$1608$c3e8da3$5496439d@news.astraweb.com> <1460343095.1633279.574715601.355BA760@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de u/EcJn5Zxbn9ROFT9hzE7AngXyXHVPxS5ZtFD/oDoJPg== 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; 'received:209.85.223': 0.03; 'cpython': 0.05; '(self,': 0.07; '*args,': 0.07; 'cc:addr :python-list': 0.09; '(1,': 0.09; 'positional': 0.09; 'subject:create': 0.09; 'tuple': 0.09; 'def': 0.13; 'argument': 0.15; 'prototype': 0.15; '2016': 0.16; 'at.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'sequence,': 0.16; 'somewhere.': 0.16; 'tuple,': 0.16; 'wrote:': 0.16; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'arguments': 0.22; 'pass': 0.22; 'second': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message-id:@mail.gmail.com': 0.27; 'built.': 0.29; 'sure,': 0.29; 'anywhere': 0.30; 'possibly': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'keyword': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'requirement': 0.37; 'detail': 0.38; 'received:209': 0.38; 'does': 0.39; 'ever': 0.60; 'chrisa': 0.84; 'execution.': 0.84; 'ultimately,': 0.84; 'to:none': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=2ktYyyvQCVOhOE2CZWODuIFLwOJ7tdAFMjT/2XE7/gE=; b=YIpgUj0hg3MZ9MehZcP+BnTqqFnlDimDIZIdlUh+MD3hJdcREr7mPxYLjOQZfJyK17 ALXP6ktmu7esBxmWdwesUn2Lfb98mM3311+jWyHIV4JDDAVIVZacm40o3MFlM//iJ2MS SKpBZAKG3XHqGM1UnsQj51SPL/QHb3y7L+1St25J3LixwWJgHJMIwLpJ7ewFzxVVZ5H2 mAjVsicf7X23OnMdRcWsLG+LR3D0gNP4aVZp0Y/aKeIxDjcSyG4nDLOH/WHBIf6OrPMr B8JmW7Rg5LbGvWkLph0Zj/ouuxCyXlb+s9pfG+XnCE3O90i2aYoeK/mTwKprdyPNLTJ4 hS6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=2ktYyyvQCVOhOE2CZWODuIFLwOJ7tdAFMjT/2XE7/gE=; b=HD27HN8UotFtdG03PMGZjTDRD/fm47uwQ70Z53+wfTwD5am5JcsfmB3Fsi3hDt5uYc flObcRezQeuGDzxx8DLQIDSPJgEure/Wyu+ebTMEln1Apko4nLUrR4GHh/164NUyF8RU iG/UzKIUTDyOijy+11eLiygbVjf+8v85YL1HNGTiAEoO//GrE0bL1sLGC1AnqYSMKCsT 6sx6dzFFIg162Dz0vzsm3ml+l2uTVXkJM8SkQdqG82/R9uAo5yQMBPRfk9djtWn2261b Hdu9sp4Y4K0JiN4ncJoNTWsc1XX5iZqD7AQtN/d0zNwvDmD55frifZNC9JPr9F4UCEXN /BKg== X-Gm-Message-State: AD7BkJK7AY6ZuvgGMhcY6M2mvmaFEHJLr2J33M6PYzIpk9/SsCotdpL/ZnnJG7XqxpCjfzfrzlBfpH7jksk9SQ== X-Received: by 10.107.169.32 with SMTP id s32mr19325924ioe.19.1460343741381; Sun, 10 Apr 2016 20:02:21 -0700 (PDT) In-Reply-To: <1460343095.1633279.574715601.355BA760@webmail.messagingengine.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <1460333911.3449208.574628345.4B46CD32@webmail.messagingengine.com> <85r3ed2ctn.fsf_-_@benfinney.id.au> <85inzp2c93.fsf@benfinney.id.au> <857fg43orj.fsf@benfinney.id.au> <570b0ca9$0$1608$c3e8da3$5496439d@news.astraweb.com> <1460343095.1633279.574715601.355BA760@webmail.messagingengine.com> Xref: csiph.com comp.lang.python:106842 On Mon, Apr 11, 2016 at 12:51 PM, Random832 wrote: > On Sun, Apr 10, 2016, at 22:32, Steven D'Aprano wrote: >> def func(arg1, arg2, arg3): >> pass >> >> func(1, 2, 3) >> >> does not create a tuple (1, 2, 3) anywhere in its execution. > > Well, the second argument to PyObject_Call and function_call is a tuple, > which had to come from somewhere. That may be a CPython implementation > detail, but what else could __call__'s prototype be but (self, *args, > **kwargs)? On the arrivals side, sure, *args. But on the departures side, you can use any sequence, and there's the whole thing of positional and keyword arguments to look at. So ultimately, all you can possibly be seeing is an implementation detail - there's no requirement that a tuple ever be built. ChrisA