Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'syntax': 0.03; '"""': 0.05; 'cpython': 0.05; 'none,': 0.05; 'does,': 0.09; 'none.': 0.09; 'terry': 0.09; 'thread,': 0.09; 'cc:addr:python-list': 0.10; 'thread': 0.11; "wouldn't": 0.11; '"is"': 0.16; 'comparison.': 0.16; 'means.': 0.16; 'reedy': 0.16; "steve's": 0.16; 'substituted': 0.16; 'valid.': 0.16; 'wrote:': 0.17; 'removed.': 0.17; 'memory': 0.18; 'written': 0.20; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'idea': 0.24; 'testing': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'implemented': 0.27; 'then.': 0.27; 'comparison': 0.29; 'objects': 0.29; 'probably': 0.29; 'subject: ?': 0.30; 'changed': 0.34; 'wrong': 0.34; 'apply.': 0.35; 'exist': 0.35; 'pm,': 0.35; 'subject:with': 0.36; 'should': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'comment': 0.38; 'object': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'think': 0.40; 'identity.': 0.65; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'reply-to:no real name:2**0': 0.72; 'as:': 0.75; 'received:74.208.4.194': 0.84; 'eliminates': 0.93 Date: Wed, 05 Sep 2012 14:40:06 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Terry Reedy Subject: Re: is implemented with id ? References: <504717ee$0$29977$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:r4OYFJv5nGOvsoexu2qQOfR9ev/V02dH8dCJHlAs1d9 st7TFGGgIpabSfsBClbWcLmpmBCpT9YZ48oH5KxD4BS3VUBHb+ l5/Oy6k04uue3+yflo/RimKLk4Djeba4wUzqgus9XEi1lHfaeZ u9tUh1PmvV/EeAW8EA346HbgWME23Ccqu0fYnhCMt0oXRM+o8w 0dAFT0YdMBjst3/KJ3eQ83kmqPRgm1abGM0EVfrHyOuXmO2sQ6 7TzIQlo6EfCrqIjM13i4mZTRBgTw5eVMUsPIUdKuYuOdwoc6dv jKJ3drxQ9nSmQs5lk6NRfExrm+fv1h7C+sK7/XM1j91OWOu7Q= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name 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: 41 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346870431 news.xs4all.nl 6926 [2001:888:2000:d::a6]:44169 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28537 On 09/05/2012 02:27 PM, Terry Reedy wrote: > On 9/5/2012 8:48 AM, Ramchandra Apte wrote: > >> Seeing this thread, I think the is statment should be removed. >> It has a replacement syntax of id(x) == id(y) > > The thread is wrong then. > > If the implementation reuses ids, which CPython does, > is > must be implemented as > > internal-tem1 = > internal-tem2 = > id(internal-tem1) == id(internal-tem2) > > in order to ensure that the two objects exist simultaneously, > so that the id comparison is valid. > > > and "a==True" should be automatically changed into memory comparison. > > I have no idea what that means. > It's probably a response to Steve's comment """ In general, you almost never need to care about IDs and object identity. The main exception is testing for None, which should always be written as: if x is None """ Somehow he substituted True for None. Anyway, if one eliminates "is" then Steve's comment wouldn't apply. -- DaveA