Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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; 'python:': 0.09; 'creates': 0.14; "wouldn't": 0.14; '"a"': 0.16; '"b"': 0.16; '"in': 0.16; 'andreas': 0.16; 'bye,': 0.16; 'pointers,': 0.16; 'pointers.': 0.16; 'subject: \n ': 0.16; 'language': 0.16; 'wrote:': 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; 'points': 0.29; 'thus': 0.29; 'location,': 0.31; 'object.': 0.31; 'another': 0.32; 'subject: (': 0.35; 'good.': 0.35; 'received:google.com': 0.35; 'i.e.': 0.36; 'object,': 0.36; 'should': 0.36; 'received:10': 0.37; 'message- id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'first': 0.61; 'name': 0.63; 'term': 0.63; 'places': 0.64; 'different': 0.65; 'containing': 0.69; 'subject:gets': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=P+u0uOoPh+2emJsB/fCh88ITER3tWWD33E2Jw5txlGE=; b=wVFUgHw7Oks2jbhiLfGlhmRePmbMIiiEvz2i+jlqW95NbM5E35O24UK8zYx9mxO63y KDRtFm3ySWzwGzM8p+ZFQoEYvO+yQR+hNVfvfWKXIOU3gADA4Te/YXjIpJ71Vh5Jq2Gh P/PNaAEVVEtrez7s2Rtx/quOMNerOmy+C9fXqEb7DQhIjBUmD+QsNb6Si7vQRtKkEMCa 8x10Q75ulJZxaVvyzpSkcVqY7ytWFI1c+Vu8/KCHU5Rnc8hA6qRHp6vJtnh814uffnWW saD5ig2mnQFzOFG0W6cqR5jmMcroiZhS4MYUdQ8+qGfHGef/qfPJ27UUEMiJNqsY9v6z 4Tbw== X-Received: by 10.14.205.4 with SMTP id i4mr2141728eeo.122.1371381727758; Sun, 16 Jun 2013 04:22:07 -0700 (PDT) Date: Sun, 16 Jun 2013 13:22:04 +0200 From: Andreas Perstinger User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: python-list@python.org Subject: OT: C vs Python terminology (was: A certainl part of an if() structure never gets executed) 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> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 48 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371381735 news.xs4all.nl 15966 [2001:888:2000:d::a6]:56498 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48440 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". > 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. > 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