Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Antoon Pardon Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Wed, 25 Nov 2015 22:05:30 +0100 Lines: 45 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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de snwNc1grM5aUhMUoz6ZM5QzbpLaK+dShN3/IJ+Gm/Ktg== 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; 'retrieved': 0.05; 'sufficient': 0.05; 'expressions': 0.07; 'imply': 0.07; 'compute': 0.09; 'literal': 0.09; 'notation.': 0.09; 'tuple': 0.09; 'python': 0.10; 'wed,': 0.15; '(3,': 0.16; 'constructs': 0.16; 'inclined': 0.16; 'literal.': 0.16; 'literals': 0.16; 'literals,': 0.16; 'literals.': 0.16; 'notations': 0.16; 'quoted': 0.16; 'received :adsl-dyn.isp.belgacom.be': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'language': 0.19; '2015': 0.20; 'constant': 0.22; 'am,': 0.23; 'needed.': 0.23; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; "doesn't": 0.26; 'supported': 0.27; 'values': 0.28; 'about.': 0.29; 'notation': 0.29; 'sentence': 0.29; 'types.': 0.29; 'received:be': 0.30; "can't": 0.32; 'says': 0.32; 'point': 0.33; 'values.': 0.33; 'definition': 0.34; 'nov': 0.35; 'something': 0.35; 'but': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'say': 0.37; 'things': 0.38; 'anything': 0.38; 'mean': 0.38; 'does': 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'still': 0.40; 'some': 0.40; 'claim': 0.61; 'no.': 0.62; 'charset:windows-1252': 0.62; 'believe': 0.66; 'talking': 0.67; 'therefore': 0.67; 'intelligent': 0.76; 'expresses': 0.84; 'pardon': 0.84; 'received:195.238': 0.84; 'schreef': 0.84; 'received:192.168.1.7': 0.91 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CbAACmIVZW/9Xi9VENUYR9vkIBDYFmhg8CgX0UAQEBAQEBAYU+AQEBAwF4BgsLGAkWDwkDAgECAUUTBgICiCINrUSNAYQcAQEIAgEghlSEfoUnhBIBBJJvg2iNNZxeHwEBhEdxAYUrAQEB User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 In-Reply-To: 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:99491 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. > How about tuple(1, 2+3, abs(-19))? Still a constant value of a built-in type. Same reasoning. > I think the most important word in the definition you quoted is > actually "notation". It says it right there: literals are not > "constant values", but notations for *expressing* constant values. And how does that make a difference? > The tuple display notation expresses values that may be constant but > need not be. Therefore it's not a literal notation. Not in general no. It doesn't imply that not any tuple display notation is a literal notation. Expression may be constant but need not be, that is no reason to claim that anything that is an expression can't be a literal. -- Antoon.