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 19:27:56 +0100 Lines: 40 Message-ID: References: <56547337.4000709@rece.vub.ac.be> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1maHDadyU0T55x2C7YN7IwKh1Y592u+HGcgbdPhsdz3Q== 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; 'value,': 0.03; 'compiler': 0.05; 'tries': 0.05; 'expressions': 0.07; 'literal': 0.09; 'tuple': 0.09; 'tuple.': 0.09; 'python': 0.10; 'syntax': 0.13; 'wed,': 0.15; '(3,': 0.16; '(x,': 0.16; "can't.": 0.16; 'constructs': 0.16; 'elephant': 0.16; 'literal.': 0.16; 'literals': 0.16; 'literals,': 0.16; 'literals.': 0.16; 'notations': 0.16; 'received:adsl-dyn.isp.belgacom.be': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'which,': 0.16; 'wrote:': 0.16; 'language': 0.19; 'versions': 0.20; '2015': 0.20; 'are.': 0.22; 'constant': 0.22; 'seems': 0.23; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'supported': 0.27; 'not.': 0.27; 'right.': 0.27; 'idea': 0.28; 'values': 0.28; 'about.': 0.29; 'argue': 0.29; 'types.': 0.29; 'themselves': 0.29; 'received:be': 0.30; 'fixed': 0.31; 'point': 0.33; 'usually': 0.33; 'optimize': 0.33; 'steven': 0.33; 'so,': 0.35; 'displays': 0.35; 'nov': 0.35; 'something': 0.35; 'but': 0.36; 'instead': 0.36; 'cases': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'display': 0.37; 'starting': 0.37; 'things': 0.38; 'someone': 0.38; 'why': 0.39; "didn't": 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; 'your': 0.60; 'charset:windows-1252': 0.62; 'matter': 0.63; 'rare': 0.66; 'talking': 0.67; 'special': 0.73; "d'aprano:": 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: A2CVAQBK/VVW/9Xi9VENSwbDQIFmhg8CgX0SAQEBAQEBAYU+AQEBAwF4BgsLGAkWDwkDAgECAUUTCAKIIg2tDYx5hBwBAQgCASCGVIR+hEpdhBIBBJZXjTWBXJcQg3InAYRAhh0BAQE User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 In-Reply-To: <5655f27b$0$1614$c3e8da3$5496439d@news.astraweb.com> 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:99472 Op 25-11-15 om 18:40 schreef Steven D'Aprano: > On Wed, 25 Nov 2015 08:56 pm, Antoon Pardon wrote: > >> Since (x, y, z) is not a fixed value, it is not a literal. > > Right. And therefore, (x, y, z) syntax is not syntax for a literal. Hence > why the Python docs call it a tuple display instead of a tuple literal -- > no matter what x, y, z are. Even if they themselves are literals, that's > just a special case that *some* compiler versions may be able to handle. > > You call this "picking nits", but if so, they are nits that are twice the > size of an an elephant and painted bright yellow. Your language arguing > about "tuple literals" seems to be based on the idea that it is usually a > constant and that cases like (x+1, y+2) is some unusual, rare corner > case -- what you call "nits". 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. > Its not. The most general case is that a > tuple display is an expression which, after evaluation, constructs a tuple. > Those few cases where the compiler can optimize it into a constant are the > nits, not the majority of cases when it can't. The nits, depend on what someone tries to argue. Since I didn't try to argue that tuple displays in general are literals but argued for very specific tuple values to be literals, you starting about tuple displays is going of on a tangent that has little to do with what I was arguing. -- Antoon