Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail 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; 'python.': 0.02; 'python,': 0.02; 'explicitly': 0.04; 'languages,': 0.04; 'root': 0.04; 'subject:Python': 0.05; 'level,': 0.07; 'variables.': 0.07; 'python': 0.09; 'pointers': 0.09; 'semantics': 0.09; 'cc:addr :python-list': 0.10; 'programmer': 0.11; 'identifiers': 0.16; 'naming': 0.16; 'stuff.': 0.16; 'subject:Objects': 0.16; 'surprising': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'wrote:': 0.17; 'basically': 0.17; 'pointer': 0.17; 'variables': 0.17; 'obviously': 0.18; 'memory': 0.18; 'variable': 0.20; 'mostly': 0.20; "i'd": 0.22; 'cc:2**0': 0.23; "python's": 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'coding': 0.27; 'wonder': 0.27; 'c++': 0.27; 'about.': 0.29; "d'aprano": 0.29; 'steven': 0.29; "i'm": 0.29; 'related': 0.30; 'sense': 0.31; 'located': 0.31; 'addresses': 0.32; 'data,': 0.35; 'pm,': 0.35; 'received:192.168.0': 0.35; 'something': 0.35; 'there': 0.35; 'but': 0.36; 'two': 0.37; 'being': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'comment': 0.38; 'fact': 0.38; 'some': 0.38; 'description': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'end': 0.40; 'think': 0.40; 'address': 0.60; 'most': 0.61; 'between': 0.63; 'information': 0.63; 'more': 0.63; 'our': 0.65; 'differences': 0.65; 'sounds': 0.71; 'disagreement': 0.84; 'hardly': 0.84; 'received:192.168.0.3': 0.84 Date: Sun, 26 Aug 2012 00:25:06 -0500 From: Evan Driscoll User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: "Steven D'Aprano" Subject: Re: Re: Objects in Python References: <18409992-1e28-4721-8e64-60c69668da4e@googlegroups.com> <87d32i1ntc.fsf@benfinney.id.au> <5035d3e4$0$1645$c3e8da3$76491128@news.astraweb.com> <50366ec8$0$6574$c3e8da3$5496439d@news.astraweb.com> <503840c5$0$6574$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <503840c5$0$6574$c3e8da3$5496439d@news.astraweb.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1345958740 news.xs4all.nl 6856 [2001:888:2000:d::a6]:57899 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:27902 On 08/24/2012 10:04 PM, Steven D'Aprano wrote: > The fact that the end result is the same is hardly surprising -- Python's > VM is built on top of C pointer indirection, so of course you can start > with pointers and end up with Python semantics. But the practice of > coding are very different: > > * in C, I care about identifiers ("names") in order to explicitly manage > addresses and pointers as a means to reach the data I actually care about; > > * in Python, I care about identifiers in order to reach the data I > actually care about. > So I find this comment very interesting. It makes me wonder if the root cause of our (pretty minor) disagreement is in some sense related to our mental models of *C* variables. I'm actually not much of a C programmer specifically, but I do a lot of C++ stuff. Of those two descriptions, I'd actually say that the Python description sounds more like how I think about variables in C++ most of the time. Obviously there are differences between value and reference semantics between the two languages, but thinking about some variable being located at some address in memory is something that I actually do pretty rarely; I basically think of variables as naming data, and addresses mostly come into play when thinking about points-to and aliasing information at a more abstract level, much the same as I do in Python. Evan