Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Random832 Newsgroups: comp.lang.python Subject: Re: Parens do create a tuple Date: Mon, 11 Apr 2016 09:42:13 -0400 Lines: 31 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> <570b2330$0$1588$c3e8da3$5496439d@news.astraweb.com> <1460352479.2404917.574799201.61DF3CED@webmail.messagingengine.com> <570b59db$0$1598$c3e8da3$5496439d@news.astraweb.com> <1460382133.3205062.575169425.0FE1EC18@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de +irEUAxva2NOWEr0jzRLXgmNPM4FJL60i8hNAC5wJAhQ== 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; '*args': 0.09; 'positional': 0.09; 'received:internal': 0.09; 'subject:create': 0.09; 'tuple': 0.09; 'python': 0.10; '(more': 0.16; '23,': 0.16; 'examples?': 0.16; 'involved?': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:io': 0.16; 'received:messagingengine.com': 0.16; 'received:psf.io': 0.16; 'sequence,': 0.16; 'wrote:': 0.16; '>>>': 0.20; "aren't": 0.22; 'arguments': 0.22; 'assuming': 0.22; 'suppose': 0.22; 'visible': 0.22; 'code.': 0.23; 'defined': 0.23; 'import': 0.24; 'header:In- Reply-To:1': 0.24; 'mon,': 0.24; 'skip:i 40': 0.27; 'function': 0.28; 'second,': 0.29; 'weak': 0.29; "i'm": 0.30; 'anywhere': 0.30; 'language.': 0.32; "d'aprano": 0.33; 'steven': 0.33; 'question,': 0.35; 'needed': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'two': 0.37; 'being': 0.37; 'itself': 0.38; 'received:66': 0.38; 'to:addr:python.org': 0.40; 'where': 0.40; 'called': 0.40; 'your': 0.60; 'header :Message-Id:1': 0.61; 'show': 0.62; 'stand': 0.67; 'mistaken': 0.84 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=fldS21g0WHuPX648Scjr+nnw7Nc=; b=AnHdZL 5UcTzNkDWeL4pUkDQGPiaZM7yXTaGlowXt34DZ8jia/fauwykmNIzRqX18/xQIp+ N7jIVgsr59rV9Z4M3kBowHD3dLqhy++qYdR7EEDsevEG1kcfEsWO7pazmW5Tofev QOORfy1FqtlvdY09iORfS+gS277LadQdadUAk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=fldS21g0WHuPX64 8Scjr+nnw7Nc=; b=BQTaPCtGeqAz/Bv/2uvGQCe3LIUezPOULQEPTz+nJ+4ON6m j2l7lp0A6nsrNtVuRV2zTk5TqMwfiycZb7re0f7GDVJQWdObMZ+1pMP2dTbPNunF Uvy/Q4e71nTqD2CxahloMP09UpnYhqvz9DpZfPR+oYtVVpsBFvlkhiUpne74= X-Sasl-Enc: DtQF2gshZIxZfieT0AtDlO7BiX3LjCyj4X65SO28hE+g 1460382133 X-Mailer: MessagingEngine.com Webmail Interface - ajax-82e6ff7b In-Reply-To: <570b59db$0$1598$c3e8da3$5496439d@news.astraweb.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: <1460382133.3205062.575169425.0FE1EC18@webmail.messagingengine.com> 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> <570b2330$0$1588$c3e8da3$5496439d@news.astraweb.com> <1460352479.2404917.574799201.61DF3CED@webmail.messagingengine.com> <570b59db$0$1598$c3e8da3$5496439d@news.astraweb.com> Xref: csiph.com comp.lang.python:106877 On Mon, Apr 11, 2016, at 04:01, Steven D'Aprano wrote: > What tuple that is passed to FunctionType.__call__? > > Where is the tuple in these examples? > > > py> from types import FunctionType > py> FunctionType.__call__(lambda x: x+1, 23) > 24 > py> FunctionType.__call__(lambda x, y: str(x)+str(y), 23, 42) > '2342' > > I don't see any evidence of a tuple being involved anywhere visible from > Python code. The fact that it can be called with two positional arguments in your first example, and three in your second, is itself weak evidence for this (more evidence is needed to show that these aren't keyword/positional arguments with defaults) - a pure python function that behaved as FunctionType.__call__ would have to be defined with *args and **kwargs. And, indeed... >>> inspect.signature(FunctionType.__call__) I am assuming that *args' use of a tuple is defined as part of the language. If I'm mistaken and it can be any sequence, I suppose I stand corrected. > How do you know that there's a tuple involved? (That's not a > rhetorical question, I am genuinely curious.)