Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4a.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; '*is*': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; 'ast': 0.16; 'confuse': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'sentinel': 0.16; 'singular': 0.16; 'uses,': 0.16; 'wrote:': 0.18; 'code,': 0.22; 'tests': 0.22; 'header:User-Agent:1': 0.23; 'code:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; '>>>>': 0.31; 'object.': 0.31; 'class': 0.32; 'not.': 0.33; 'programmers': 0.33; 'test': 0.35; 'object,': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'new': 0.61; 'received:173': 0.61; 'such': 0.63; 'details': 0.65; 'production': 0.68; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Reference Date: Mon, 03 Mar 2014 13:48:39 -0500 References: <53144e8d$0$2149$426a74cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <53144e8d$0$2149$426a74cc@news.free.fr> 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393872546 news.xs4all.nl 2856 [2001:888:2000:d::a6]:45673 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67573 On 3/3/2014 4:42 AM, ast wrote: > Consider following code: > >>>> A=7 >>>> B=7 >>>> A is B The 'is' operator has three uses, two intended and one not. In production code, 'is' tests that an object *is* a particular singular object, such as None or a sentinel instance of class object. In test code, 'is' can also be used to test details of a particular implementation, such as pre-allocation of small ints. New python programmers also use it to confuse themselves. -- Terry Jan Reedy