Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Wed, 25 Nov 2015 15:38:27 -0700 Lines: 35 Message-ID: References: <56547C53.8030407@rece.vub.ac.be> <5654864E.2070906@rece.vub.ac.be> <56549324.8020607@rece.vub.ac.be> <56549F15.40206@rece.vub.ac.be> <5654B037.6020107@rece.vub.ac.be> <56550273$0$1585$c3e8da3$5496439d@news.astraweb.com> <5655f27b$0$1614$c3e8da3$5496439d@news.astraweb.com> <5655FDAC.4070305@rece.vub.ac.be> <5656229A.2000309@rece.vub.ac.be> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 9g6x/IclsSOWt7oGoQKVhQ625nmZuDYlqVwdSWVaTdTQ== 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; 'retrieved': 0.05; 'sufficient': 0.05; 'expressions': 0.07; 'collections': 0.09; 'compute': 0.09; 'tuple': 0.09; 'python': 0.10; 'wed,': 0.15; '(3,': 0.16; '12)': 0.16; 'constructs': 0.16; 'inclined': 0.16; 'literal.': 0.16; 'literals': 0.16; 'literals,': 0.16; 'literals.': 0.16; 'notations': 0.16; 'received:209.85.223.173': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'language': 0.19; '>>>': 0.20; '2015': 0.20; 'constant': 0.22; 'pass': 0.22; 'am,': 0.23; 'needed.': 0.23; 'this:': 0.23; 'import': 0.24; 'header:In-Reply- To:1': 0.24; 'supported': 0.27; 'message-id:@mail.gmail.com': 0.27; 'values': 0.28; 'about.': 0.29; 'sentence': 0.29; 'types.': 0.29; "i'm": 0.30; 'point': 0.33; 'class': 0.33; 'curious': 0.33; 'received:google.com': 0.35; 'nov': 0.35; 'something': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'things': 0.38; 'received:209': 0.38; 'skip:p 20': 0.38; 'mean': 0.38; 'to:addr:python.org': 0.40; 'still': 0.40; 'some': 0.40; 'believe': 0.66; 'talking': 0.67; 'intelligent': 0.76; 'pardon': 0.84; 'schreef': 0.84; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=HreHZzf6Y6bun9O83fkFBxR1Yn/GC3ee/nO0du5+h/8=; b=gAbw9bTH8YDj1l0r55VJaBs1FP+rakHVIYtIdipHC59GJEn7kkC1uhaeA1TLVyM9h3 EbebOkmnZK4B/R0sSh+5u6StmeZPDLKtyhLJRbE737PIIeK6w5AZV1Hq9V305FoCXRsB 5nr6tCM/cflvoX9FHW5Ndco3bPlGYIQiY9DmralG4GJ2xtnUZyYSmVKQK2hleuhvwZZf R2jKJkPCiUwaFhxW/CcW2+KyiAphO7rnn5HUuTPMEZ2tJTJcJqu6WmXVvGfWcMSdO7pC +sC8koPOd9/NSHgdmMN8yUxyB0nsMBb3UcLYO7LQ7vg4AR6bste49THWrxGCMVH5nKJk y26Q== X-Received: by 10.107.19.12 with SMTP id b12mr43591033ioj.11.1448491147437; Wed, 25 Nov 2015 14:39:07 -0800 (PST) In-Reply-To: <5656229A.2000309@rece.vub.ac.be> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:99499 On Wed, Nov 25, 2015 at 2:05 PM, Antoon Pardon wrote: > Op 25-11-15 om 21:39 schreef Ian Kelly: >> On Wed, Nov 25, 2015 at 11:27 AM, Antoon Pardon >> wrote: >>> I don't know what you are talking about. The first thing I have argued >>> is that () is a literal. Then I have expaned that to that something >>> like (3, 5, 8) is a literal. I never argued that tuple expressions >>> in general are literals. And one way I supported my point was with the >>> following quote from the python language reference. >>> >>> Literals are notations for constant values of some built-in types. >>> >>> And I think that the things I argued were literals, were in fact >>> constant values of some built-in type. >> >> I believe that sentence from the docs is using "some" to mean "not >> all", whereas you are apparently using it to mean "any". >> >> frozenset([1,2,3]) constructs a constant value of a built-in type. >> Would you consider that a literal? > > I am inclined to say yes, because a sufficient intelligent compilor > can compute the value and store it do be retrieved and bound to a > target when needed. I'm curious then what you think of this: from collections import namedtuple class Point(namedtuple("Point", "x y")): pass Point(17, 12) Still a constant, but not a built-in type. Would you consider that a literal?