Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Laura Creighton Newsgroups: comp.lang.python Subject: Re: What is a function parameter =[] for? Date: Fri, 20 Nov 2015 02:00:02 +0100 Lines: 49 Message-ID: References: <564dbe6b$0$1610$c3e8da3$5496439d@news.astraweb.com> <564df258$0$1604$c3e8da3$5496439d@news.astraweb.com> <564e68d0$0$1608$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de NyCgnUvNRHzP53KMve3nCQ6yNUXF9cm14eUFulrIR/rA== 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; 'modify': 0.04; 'correct.': 0.07; 'pypy': 0.07; 'cc:addr:python-list': 0.09; 'abstraction': 0.09; 'address)': 0.09; 'garbage': 0.09; 'received:openend.se': 0.09; 'received:theraft.openend.se': 0.09; 'python': 0.10; 'thursday,': 0.13; 'thu,': 0.15; 'value.': 0.15; '"="': 0.16; '>on': 0.16; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'copied.': 0.16; 'from:addr:lac': 0.16; 'from:addr:openend.se': 0.16; 'from:name:laura creighton': 0.16; 'hits': 0.16; 'message- id:@fido.openend.se': 0.16; 'received:fido': 0.16; 'received:fido.openend.se': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'shallow': 0.16; 'slow,': 0.16; 'value",': 0.16; 'wrote:': 0.16; 'memory': 0.17; 'copied': 0.18; 'laura': 0.18; 'pointer': 0.18; 'refers': 0.18; '2015': 0.20; 'cc:addr:python.org': 0.20; '(the': 0.22; 'cc:2**1': 0.22; 'referring': 0.22; 'am,': 0.23; 'passing': 0.23; "python's": 0.23; 'implemented': 0.24; 'fri,': 0.27; 'this.': 0.28; 'it."': 0.29; 'pointer.': 0.29; 'received:se': 0.29; 'value)': 0.29; 'cc:no real name:2**1': 0.29; 'objects': 0.29; "i'm": 0.30; 'too.': 0.30; 'probably': 0.31; 'implement': 0.32; "d'aprano": 0.33; 'hell': 0.33; 'steven': 0.33; 'that,': 0.34; 'could': 0.35; 'nov': 0.35; 'something': 0.35; 'but': 0.36; 'there': 0.36; '(and': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'why': 0.39; 'does': 0.39; 'header:Message-Id:1': 0.61; 'here.': 0.62; 'to,': 0.63; 'guaranteed': 0.67; 'stated': 0.70; 'carrier': 0.72; "'we": 0.84; '>of': 0.84; 'batchelder': 0.84; 'header:In- reply-to:1': 0.84; 'tied': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openend.se; s=default; t=1447981204; bh=h3sr/IKylyR7lo4NwO6ihM3mwV6ifh7FhnpVeicqUXE=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=d4GEwUSGBVq4oTh8zpOsBEHwTmj5U3xMhLmuP42tBJqs5fmVUUgC7GQNeMZbxTzEC M9u0tcrxHvmPauPTmmED2WzJJdu8t0VNtOMfaXJPLg472C01qCvvqV/kgwiUEQBjkX AnOBoISUH7yii7Q1wotkKbPx0syiHbTL4EtF+znw= In-reply-to: Comments: In-reply-to Ned Batchelder message dated "Thu, 19 Nov 2015 16:36:17 -0800." Content-ID: <8291.1447981202.1@fido> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (theraft.openend.se [82.96.5.2]); Fri, 20 Nov 2015 02:00:04 +0100 (CET) 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:99116 In a message of Thu, 19 Nov 2015 16:36:17 -0800, Ned Batchelder writes: >On Thursday, November 19, 2015 at 7:28:44 PM UTC-5, Steven D'Aprano wrote= : >> On Fri, 20 Nov 2015 05:50 am, BartC wrote: >> = >> = >> > I said that Python's "=3D" does a very shallow copy. And I stated tha= t in >> > A=3DB, something of B must be copied into A. >> > = >> > I (and probably others) would like to know why none of that is correc= t. >> > But I suspect I'm not wrong. >> = >> Nothing of B is copied. > >I think we are stuck in a simple terminology conflict here. There is som= ething >of B copied. The name B refers to a value. In CPython, that reference i= s a >pointer. That pointer (the memory address) is copied from B to A. > >Nothing of "B's value", that is, the object B is referring to, is copied.= But >there is something about B (the pointer to its value) that is now also so= mething >about A, because A also has that pointer. > >--Ned. In PyPy we do this too. But we don't copy a memory-address pointer. We have a moving garbage collector, and no objects are in any way guaranteed to be at their last memory address. We copy a thing that, when you ask it nicely, spits out "where the hell is the object right now, because I want to modify it." But this thing is in no way tied to any particular place in any DRAM. It hits PyPy at an abstraction layer above that of 'we write 1s and 0s here' so if you want to implement python on a message passing system implemented by carrier pigeon, we could do this. It would be slow, however. :) Laura