Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: Explaining names vs variables in Python Date: Thu, 3 Mar 2016 00:48:35 +1100 Lines: 18 Message-ID: References: <56d6ac61$0$23633$edfadb0f@dtext02.news.tele.dk> <56d6c146$0$1615$c3e8da3$5496439d@news.astraweb.com> <87y4a1t5wj.fsf@elektro.pacujo.net> <87twkpt2w7.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de F//DgYoo6OU5jGcSP71O7gF2NFeQwGw1J72yo/xm/i5Q== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.05; 'defines': 0.07; 'cc:addr:python-list': 0.09; 'python': 0.10; 'python.': 0.11; 'thu,': 0.15; '2016': 0.16; 'distinct': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'integer.': 0.16; 'intrinsic': 0.16; 'mine.': 0.16; 'objects?': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'language': 0.19; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'am,': 0.23; "python's": 0.23; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; 'object,': 0.27; 'objects': 0.29; 'that,': 0.34; 'received:google.com': 0.35; 'returning': 0.35; "isn't": 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'anything': 0.38; 'sure': 0.39; 'mar': 0.65; 'bothered': 0.66; 'evaluate': 0.72; 'chrisa': 0.84; 'guarantee.': 0.84; 'to:none': 0.91 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; bh=mpU6qfOrQHlYphOHJMdTl7Jaj8EfGDTyWREOHPK2vW0=; b=vS8lQQRM4O5s/LzfPDnIL4BkUAstcMMbKsvg9XKZEsmqN57Xcp2M23PIeVUkc9MocO NxiIfJFcOdxom8FSxLiLfzIoWUcKnBVUNSIvOtGKFx91NzvCdtCeG+FutP/juSh11iCZ kXGpjrUhPdonkH6NW+OgCj/Wfhysfr1CWmTcYZhLutw1/ovqkOT20VcH6KDlpaMbFTeW U1yBJNB7d2YEQqgB+0j0NLvhLEaySMIy2SOHQIT8ZcrKw1PJruui8yjtyR8ibYPKRyVk UEfTwrMFjQKcAbkRADH319NJ//82y78l/ja5di6KtCWef8hIuHdVoZIwwVLM1s6AGI/0 yTSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=mpU6qfOrQHlYphOHJMdTl7Jaj8EfGDTyWREOHPK2vW0=; b=BbjDfZoM0pNBfg2nZOiaiIeqaKzh9Xt3INaea6zFvyc6WrssquE0LH2GhN2pNT1Iqi mkIEmUZMaeRwG1Uwu2aAjO+OPP+8kBTpcJHERraBRiTn27KHop0gDKviEmHyIv7oLRQx j+7iyoKaYVT4uPYBw0UjoT9DQWCIlOv9rZxTgxd1tHKI9Nog/HWHC6fTfDOtfFgESp1D 0MRSBuLmnuiW/faVRQ4Lqxg8Mv2771KRaRMQUEGbfefOJ0+KW0BflmGMsxxUFEivf9/a 9oo4w/pGKRzmdn6hjLMo6mGKrLkx+P+skd2qQudhIiJVUhvJWaqErBD5AZoEOIA/IALi SBpg== X-Gm-Message-State: AD7BkJKMekTonB/UI07vWuE9+tzbmeA5KZAyVduH0l2CdH9yZobd7DsVYbT9mEVpR0ioeup2XLRX+ai3Xg0iYw== X-Received: by 10.50.43.168 with SMTP id x8mr4863014igl.92.1456926515533; Wed, 02 Mar 2016 05:48:35 -0800 (PST) In-Reply-To: <87twkpt2w7.fsf@elektro.pacujo.net> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 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:103868 On Thu, Mar 3, 2016 at 12:39 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> Python defines that every object has an identity, which can be >> represented as an integer. Since this is an intrinsic part of the >> object, no two distinct objects can truly have identical >> characteristics. Python's objects are like rifles - there are many >> like it, but this one is mine. > > How can you be sure Python isn't returning the same id value for two > distinct objects? The same way I can be sure about anything else in Python. It's a language guarantee. If you're bothered by that, you should also be concerned that str(x) might not actually call x.__str__(), or that a+b*c might evaluate the addition before the multiplication. ChrisA