Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52358

Re: Python Basic Doubt

Path csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'true,': 0.05; 'subject:Python': 0.06; '(so': 0.07; 'immutable': 0.09; 'integers': 0.09; 'python': 0.11; 'argument.': 0.16; 'distinct': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'identifiable': 0.16; 'mutability': 0.16; 'mutable': 0.16; 'tuple': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'aug': 0.22; 'instance,': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'equality': 0.31; 'tuples': 0.31; 'languages': 0.32; 'entirely': 0.33; 'level.': 0.33; 'could': 0.34; 'objects': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'crazy': 0.36; 'two': 0.37; 'easily': 0.37; 'to:addr:python-list': 0.38; 'issue': 0.38; 'list,': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'truly': 0.60; 'august': 0.61; 'strictly': 0.61; "you're": 0.61; 'between': 0.67; 'containing': 0.69; 'identity;': 0.84; '2013': 0.98
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:to :content-type; bh=c+wcPd2Aj71HgWLsheWiWAetqiyfK1e99BzXeiGgLqk=; b=lzm3hUbhe53+eEGvkd2pxRGUCmvvrSvBY846Y6+Pq4Kf3iDACPGVRmisNde79UM+4X 4mYKeJO07VPAKfdTWhl2nRX4YC7CyRJk2lM+/z+BNmNo3/WZ3Vbs4UstLbu7Ftt+bepB C6Ygkih5z/TSqJDyvqPy2hM+T4lxbXOabmnqvijzq54kKXN4XZmVvNOj3e9uCBMyRNm3 fZTMrdNhjdB3BWvwRuo/qiuCDLpIajpY6m6gNIimoOBY/kfUlGaNVdKCck8SQulWgrmx FqfClewu+KDZc2kXN/gK45rb6UY+a2V68JaJdsBcDBwmij+z4C4AdTIHCdS6noOLx0t+ EAog==
MIME-Version 1.0
X-Received by 10.220.169.146 with SMTP id z18mr3801040vcy.80.1376195932048; Sat, 10 Aug 2013 21:38:52 -0700 (PDT)
In-Reply-To <CAN1F8qUEugJfufXHFzRiK=0pMiwfWsS4A9fEeugLxvW1QD4ZHg@mail.gmail.com>
References <CAL0E0u6wO_UBniWoSpePvhKhPDG_nf4p1rqYYrGwzoHTqp6ZHA@mail.gmail.com> <20130810114040.6ac78fe8@bigbox.christie.dr> <52067FDA.2030908@gmail.com> <5206B527.6080700@islandtraining.com> <CAPTjJmoM=MU2eqa2i_5_RbveXMqScQqu_uFjonwdrZX7Vsc49g@mail.gmail.com> <5206DDED.8030506@islandtraining.com> <CAPTjJmrUGWnQ40iPiJtdKAB8WTbjRaM+bzUmukY6Cb4FvOi2JQ@mail.gmail.com> <5207034A.6070608@islandtraining.com> <CAPTjJmoj5K838vfjuEx9HGDuSb_Uq3=OckqksEk0YsM5Qb4P2w@mail.gmail.com> <CAN1F8qUEugJfufXHFzRiK=0pMiwfWsS4A9fEeugLxvW1QD4ZHg@mail.gmail.com>
Date Sun, 11 Aug 2013 05:38:51 +0100
Subject Re: Python Basic Doubt
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.465.1376195940.1251.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376195940 news.xs4all.nl 15897 [2001:888:2000:d::a6]:41155
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52358

Show key headers only | View raw


On Sun, Aug 11, 2013 at 5:04 AM, Joshua Landau <joshua@landau.ws> wrote:
> On 11 August 2013 04:43, Chris Angelico <rosuav@gmail.com> wrote:
>> The
>> distinction between the two is important when the objects are mutable
>> (so they have an identity that's distinct from their current values).
>
> I don't follow this argument. Tuples are immutable yet you're crazy if
> you check their equality with "is". In Python identity and equality
> are very distinct.

True, it's not strictly an issue of mutability of that one level. But
anything that's truly immutable (a tuple/frozenset of ints/strings)
can in theory be interned. In some languages (no Pythons as far as I'm
aware, though one could easily do so and still be fully compliant),
all strings are automatically interned, so there's no difference
between value and identity for them. A tuple containing a list, for
instance, needs its identity; a tuple of three integers is
identifiable entirely by its value.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python Basic Doubt Chris Angelico <rosuav@gmail.com> - 2013-08-11 05:38 +0100

csiph-web