X-Received: by 10.182.227.137 with SMTP id sa9mr22523959obc.44.1456931299868; Wed, 02 Mar 2016 07:08:19 -0800 (PST) X-Received: by 10.50.87.40 with SMTP id u8mr18021igz.0.1456931299838; Wed, 02 Mar 2016 07:08:19 -0800 (PST) Path: csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!hb3no10714966igb.0!news-out.google.com!k1ni6547igd.0!nntp.google.com!hb3no10714960igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Wed, 2 Mar 2016 07:08:19 -0800 (PST) In-Reply-To: <87povdt1ec.fsf@elektro.pacujo.net> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=117.215.22.187; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui NNTP-Posting-Host: 117.215.22.187 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> <87povdt1ec.fsf@elektro.pacujo.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Explaining names vs variables in Python From: Rustom Mody Injection-Date: Wed, 02 Mar 2016 15:08:19 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:103874 On Wednesday, March 2, 2016 at 7:42:09 PM UTC+5:30, Marko Rauhamaa wrote: > Chris Angelico : > > > 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. > > Actually, my question is (intentionally) nonsensical. > > The sameness or distinctness of two objects is not directly defined in > Python. The definition is simply: > > Two objects X and Y are called identical if > > X is Y > > evaluates to a true value. > > Additionally, we have: > > If objects X and Y are identical, it is guaranteed that > > id(X) == id(Y) > > evaluates to a true value. > > Even more strongly, we have: > > For any objects X and Y, > > id(X) == id(Y) if X is Y else id(X) != id(Y) > > evaluates to a true value. > > What is missing is the rules that are obeyed by the "is" operator. is is not is is is was [fermionic or bosonic?]