Path: csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'subject:Python': 0.06; 'context': 0.07; 'puts': 0.07; 'immutable': 0.09; 'python:': 0.09; 'creates': 0.14; 'thread': 0.14; "wouldn't": 0.14; '"a"': 0.16; '"b"': 0.16; '"in': 0.16; 'andreas': 0.16; 'behavior,': 0.16; 'bound.': 0.16; 'bye,': 0.16; 'pointers,': 0.16; 'pointers.': 0.16; 'language': 0.16; 'wrote:': 0.18; 'discussion': 0.18; 'variable': 0.18; 'pointed': 0.19; 'written': 0.21; 'memory': 0.22; 'header:User-Agent:1': 0.23; 'integer': 0.24; 'pointer': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'points': 0.29; 'thus': 0.29; 'are.': 0.31; 'location,': 0.31; 'object.': 0.31; 'another': 0.32; 'knows': 0.35; 'good.': 0.35; 'objects': 0.35; 'but': 0.35; 'false': 0.36; 'i.e.': 0.36; 'object,': 0.36; 'doing': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'even': 0.60; "you're": 0.61; 'first': 0.61; 'name': 0.63; 'term': 0.63; 'real': 0.63; 'places': 0.64; 'different': 0.65; 'received:74.208': 0.68; 'containing': 0.69; 'received:74.208.4.194': 0.84 Date: Sun, 16 Jun 2013 08:55:18 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: python-list@python.org Subject: Re: OT: C vs Python terminology References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> <51b926a3$0$29997$c3e8da3$5496439d@news.astraweb.com> <51ba6e92$0$29997$c3e8da3$5496439d@news.astraweb.com> <51bb454c$0$29997$c3e8da3$5496439d@news.astraweb.com> <51BD9FDC.8050006@gmail.com> In-Reply-To: <51BD9FDC.8050006@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:L/xs6SSbvGcNABdFVODUpfeUaWFs6QPhKTyicNUhhm1 jKrnI2fMY0wqABbPOWhk6432/jm0F6XR8ES0vfkEwP9FrQVHJ+ nuNfxtLF9XTDwovfOr0q/bDdKyPIrc54o2DiMt0+Tw6SXc0JeX 9ll43I582xGHWW87q1a1etOmpdrbUuX1xVGYWhJvwXscRfthyx 9F1BWC47piuLN2oKL7ZtNfX7ZibNFIqP6dLN3l80a7jQxP8IQ5 mjjeh6zfXDc293pVMzRNSUJT3ktPT5blcTa4TS8gSP8qqZhlkq bdMWff3t/1j0xBqrhc0z9UfzfJpVkVPIFLLnz2amZthJtwFAvQ pEUNw2p+AHI9U2j4iWik= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 65 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371387333 news.xs4all.nl 16000 [2001:888:2000:d::a6]:52391 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48446 On 06/16/2013 07:22 AM, Andreas Perstinger wrote: > On 16.06.2013 08:32, Denis McMahon wrote: >> C: >> >> int a, b; >> b = 6; >> a = b; >> >> In C, this places the numeric value 6 into the memory location identified >> by the variable "b", > > so far so good. > >> then copies the value from the location pointed to by "b" into the >> location pointed to by "a". > > Wrong. Neither "a" nor "b" are pointers, thus they don't point to a > memory location. > This part should be written as > "then copies the value at the location identified by "b" to the location > identified by "a". But it doesn't. It binds b to the same object to which a is currently bound. > >> b is a pointer to a memory location containing the value 6 > > a is a pointer to another memory location also containing the value 6 > > Again, neither "a" nor "b" are pointers. > "b" is the name of a memory location containing the integer value 6. > "a" is the name of another memory location containing the integer value 6. > Not even close. If you don't like the terms "bound" or "points", the perhaps you'd be happy with "b" is the name that currently knows how to find an int object containing 6. That object has no name, and never will. And it can exist for a long time with no names directly bound to it. >> Python: >> >> b = 6 >> a = b >> >> In Python, this first puts the value 6 in in a memory location and points >> "b" at that memory location, then makes "a" point to the same memory >> location as "b" points to. >> >> b is a pointer to a memory location containing the value 6 >> a is a pointer to the same memory location > > I wouldn't use the term "pointer" in context with Python. Using the > terms from the language reference I would write that as > "In Python, this first creates an integer object with value 6 and then > binds the name "b" to it. Then it binds the name "a" to the same object. > Thus both "a" and "b" reference the same object, i.e. they are different > names for the same object." > > Bye, Andreas Doing all of this discussion with immutable objects masks the real behavior, as someone can use a false model and seem to justify that model. I don't think you're doing that, but others in the thread are. -- DaveA