Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'true,': 0.04; 'none,': 0.05; 'important,': 0.07; 'immutable': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'developers,': 0.10; 'python': 0.11; 'assume': 0.11; 'jan': 0.11; 'subject:python': 0.14; '(least': 0.16; '12)': 0.16; 'assumptions': 0.16; 'confusion': 0.16; 'constructs': 0.16; 'intended.': 0.16; 'operator.': 0.16; 'pypy.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'specific,': 0.16; 'subject:class': 0.16; 'subject:object': 0.16; 'subject:type': 0.16; 'wrote:': 0.16; 'say,': 0.18; 'language': 0.19; 'object.': 0.22; 'users,': 0.22; 'defined': 0.23; 'specified': 0.23; 'header:In-Reply-To:1': 0.24; '(this': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; 'appear': 0.29; '3.1': 0.29; 'terry': 0.29; 'values': 0.30; 'print': 0.31; 'supposed': 0.31; 'true.': 0.33; 'definition': 0.34; 'gives': 0.35; 'to:addr:python-list': 0.35; 'false': 0.35; 'subject:: ': 0.37; 'received:org': 0.38; 'pm,': 0.39; 'test': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'some': 0.40; 'even': 0.61; 'leading': 0.62; 'details': 0.63; 'different': 0.64; 'details,': 0.65; 'matter.': 0.66; 'special': 0.72; 'discover': 0.73; 'carefully': 0.76; 'received:fios.verizon.net': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Everything is an object in python - object class and type class Date: Wed, 03 Jun 2015 13:17:49 -0400 References: <14976c1b-a620-426f-b529-41a3c04e9c1a@googlegroups.com> <48fc36e9-fa67-45d5-9864-0921b7e819ce@googlegroups.com> <556d931a$0$12991$c3e8da3$5496439d@news.astraweb.com> <1ad44d0f-8a98-4302-9391-51264aa258e5@googlegroups.com> <87fv6956zw.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-98-114-97-173.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1433351929 news.xs4all.nl 2888 [2001:888:2000:d::a6]:41963 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91980 On 6/3/2015 12:00 PM, BartC wrote: > That's a different matter. However, you appear to be wrong. > > print (-12 is -12) > > gives True. As does ("abc" is "abc"). I assume constructions for > immutable values will do the same (([10,20,30] is [10,20,30]) gives > False because the constructs are mutable, although it's difficult to see > how in that form). > > (This is on 2.7, 3.1 and PyPy. On 3.4.3, (-12 is -12) gives False as you > say, although (12 is 12) gives True, so not even Python can make up its > mind how it's supposed to work!) Implementation details not specified in the language definition are just that -- implementation details. The 'is' operator. which is carefully defined in the reference, has three uses: 1. test whether an object is None, or some other specific, special object. 2. for implementation developers, test whether the implementation details, including optimizations, are as intended. 3. (least important, and often leading to confusion when people make assumptions and extrapolate limited results) for users, discover implementation details. -- Terry Jan Reedy