Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Mark Lawrence Newsgroups: comp.lang.python Subject: Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?) Date: Mon, 14 Mar 2016 16:21:17 +0000 Lines: 43 Message-ID: References: <87h9gcxkd3.fsf@elektro.pacujo.net> <87shzvgbhq.fsf@elektro.pacujo.net> <56e44a4e$0$1614$c3e8da3$5496439d@news.astraweb.com> <56e5354c$0$1593$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1fQSm9c20q2y+m7lMLMXzwjb416n16ZZrU7yL74uxBLw== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.04; 'string.': 0.04; 'from:addr:yahoo.co.uk': 0.05; "'a'": 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:which': 0.09; 'url:blog': 0.10; 'python': 0.10; '2016': 0.16; 'fly': 0.16; 'programmers,': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'subject:?)': 0.16; 'wrote:': 0.16; 'case.': 0.18; 'refers': 0.18; 'tells': 0.18; 'language': 0.19; '>>>': 0.20; 'lawrence': 0.22; 'pass': 0.22; 'am,': 0.23; 'references': 0.23; 'header:In-Reply-To:1': 0.24; 'feature': 0.24; 'sort': 0.25; 'header:User-Agent:1': 0.26; 'example': 0.26; 'header:X-Complaints-To:1': 0.26; 'sense': 0.26; 'have,': 0.27; 'function': 0.28; 'context,': 0.29; "people's": 0.29; "can't": 0.32; 'knows': 0.32; 'language.': 0.32; 'useful': 0.33; 'common': 0.33; "d'aprano": 0.33; 'steven': 0.33; 'languages': 0.34; 'gets': 0.35; 'replace': 0.35; 'something': 0.35; 'but': 0.36; 'url:2012': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'received:org': 0.37; 'names': 0.38; 'rather': 0.39; 'to:addr:python.org': 0.40; 'mark': 0.40; 'called': 0.40; 'some': 0.40; 'your': 0.60; 'subject:The': 0.61; 'charset:windows-1252': 0.62; 'more': 0.63; 'different': 0.63; 'to,': 0.63; 'our': 0.64; 'between': 0.65; 'mar': 0.65; 'below.': 0.66; 'worth': 0.67; 'url:11': 0.72; '100': 0.79; 'distinguish': 0.84; 'itself?': 0.84; 'pythonistas,': 0.84; 'write:': 0.91 X-Injected-Via-Gmane: http://gmane.org/ X-Gmane-NNTP-Posting-Host: 80.234.129.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 In-Reply-To: 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: , Xref: csiph.com comp.lang.python:104835 On 14/03/2016 14:43, BartC wrote: > On 13/03/2016 09:39, Steven D'Aprano wrote: >> On Sun, 13 Mar 2016 04:54 am, BartC wrote: > >>> Common sense tells you it is unlikely. >> >> Perhaps your common sense is different from other people's common >> sense. To >> me, and many other Python programmers, it's common sense that being >> able to >> replace functions or methods on the fly is a useful feature worth having. >> More on this below. >> >> Perhaps this is an example of the "Blub Paradox": > > Perhaps it's time to talk about something which many languages have, but > Python hasn't. Not as far as I know anyway. > > That's references to names (sometimes called pointers). So if I write: > > a = 100 > f(a) > > then function f gets passed the value that a refers to, or 100 in this > case. But how do you pass 'a' itself? > > Perhaps you can say: > > f('a') > > and f can do some sort of lookup, if it knows the caller's context, for > such a name and retrieve the value that way. But that's rather > heavy-handed, and f can't distinguish between a reference to a name, and > a string. http://jeffknupp.com/blog/2012/11/13/is-python-callbyvalue-or-callbyreference-neither/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence