Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Michael Torrie Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Thu, 19 Nov 2015 15:55:50 -0700 Lines: 13 Message-ID: References: <564dbe6b$0$1610$c3e8da3$5496439d@news.astraweb.com> <564df258$0$1604$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 8ANVHKJGv8ElmAzMAkx2fAemSsvTl+dzNhRA3U4m2fPA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '(python': 0.05; 'dynamically': 0.07; 'semantics': 0.09; 'throws': 0.09; 'argument': 0.15; '42;': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'laura': 0.18; 'tells': 0.18; 'python?': 0.18; 'variable': 0.18; 'language': 0.19; 'parameter': 0.22; "python's": 0.23; 'header:In- Reply-To:1': 0.24; 'header:User-Agent:1': 0.26; 'chris': 0.26; 'said,': 0.27; 'arguments,': 0.29; 'compiled': 0.32; 'traditional': 0.33; 'message-id:@gmail.com': 0.34; 'languages': 0.34; 'list': 0.34; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'late': 0.38; 'mean': 0.38; 'means': 0.39; 'does': 0.39; "didn't": 0.39; 'received:192': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'default': 0.61; 'charset:windows-1252': 0.62; 'course': 0.62; 'more': 0.63; 'binding': 0.66; 'surprise': 0.72 X-Virus-Scanned: amavisd-new at torriefamily.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.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:99103 On 11/19/2015 02:21 PM, BartC wrote: > (Python returns 42; so that means my languages are more dynamic than > Python? That's hard to believe!) It tells me your language does late binding for default arguments, which does mean the default argument can dynamically change at call time, which would surprise me if I didn't know about it. Either form of binding is acceptable, and I don't think it makes a language more or less dynamic. Of course as Chris and Laura have said, a list as a default parameter throws people off because of the semantics of mutability, and the fact that Python's variable model does not follow the traditional memory box model used in compiled languages like C.