Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'operator': 0.03; 'guido': 0.05; 'class,': 0.07; 'compiler': 0.07; 'pointers': 0.09; 'variables.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '"&"': 0.16; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; "python's": 0.19; 'feb': 0.22; 'saying': 0.22; 'cc:addr:python.org': 0.22; 'pointer': 0.24; 'decide': 0.24; 'fairly': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'subject:list': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'breaking': 0.31; 'could': 0.34; 'received:google.com': 0.35; 'add': 0.35; 'really': 0.36; 'done': 0.36; 'generic': 0.38; 'even': 0.60; 'skip:* 10': 0.61; 'simply': 0.61; "you're": 0.61; "you'll": 0.62; "you've": 0.63; 'different': 0.65; 'special': 0.74; '2015': 0.84; 'actually,': 0.84; 'around,': 0.84; 'difference.': 0.84; 'to:none': 0.92; 'tomorrow': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=cWapymuJ2Ddn0Q75ADyZ9aeqgW130VsqJYSjfXHQTF8=; b=hbJPBiBb49Me/ulfabyg7eUKp7J4r6USDvfT6ucy338Vw44TvKH/tFNMJDkXdQNuF+ JD5iL7vLPs/3bSH+KR0boXA0RCUntitH+fUlizqcHMP6THNxwrPLYBNdSuBN8WVyJ7+a qXEXmI9ML1A1JdjNGW4CjEUNqCDz2I4qSFyxsZzxhZENNrUBLLRuzZ7MJIeNUaM/OqIv FeYkY1dqakcBBsU3OtYet/7tK6eisZcsp7yKVQvU8vzTjZc68nKq/lQJc0Xgr4863g8r 4eAuS9My2nTEEXLf6kY9JoAD5WeUdt5Zld79dowomnSxuX+pPOjVKyAxJe6xqocGXTUM j+sA== MIME-Version: 1.0 X-Received: by 10.107.128.219 with SMTP id k88mr15599555ioi.27.1424719068275; Mon, 23 Feb 2015 11:17:48 -0800 (PST) In-Reply-To: <87385wh2ho.fsf@elektro.pacujo.net> References: <54eb2357$0$3011$426a74cc@news.free.fr> <8761ascwt4.fsf@elektro.pacujo.net> <87385wh2ho.fsf@elektro.pacujo.net> Date: Tue, 24 Feb 2015 06:17:48 +1100 Subject: Re: list storing variables From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424719540 news.xs4all.nl 2848 [2001:888:2000:d::a6]:60994 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:86256 On Tue, Feb 24, 2015 at 6:06 AM, Marko Rauhamaa wrote: > What I'm saying is that there's nothing special about Python's object > model or variables. Guido could decide tomorrow to add a C-esque "&" > operator to Python without breaking a single existing Python program. > The Python compiler would simply generate code like above. Actually, there's a fairly huge difference. All you've done is create a thing which can set a global... you don't have any way to pass pointers around, like you can in C. (And that's even without getting into pointer *arithmetic*.) You have to construct a dedicated "thing" in your source code for every pointer you want to be able to work with. And if you try to make a single generic "Ampersand" class, what you'll find is that you're working with namespaces, not addresses. So Python's name-binding model really is fundamentally different from C's stuff-in-memory model. ChrisA