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


Groups > comp.lang.python > #59102

Re: 'isimmutable' and 'ImmutableNester'

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <random832@fastmail.us>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.028
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; "subject:' ": 0.07; 'received:internal': 0.09; 'members)': 0.16; 'message- id:@webmail.messagingengine.com': 0.16; 'mutable': 0.16; 'overriding': 0.16; 'received:10.202': 0.16; 'received:10.202.2': 0.16; 'received:66.111': 0.16; 'received:66.111.4': 0.16; 'received:messagingengine.com': 0.16; 'string,': 0.24; 'header:In- Reply-To:1': 0.27; 'to:2**1': 0.27; 'function': 0.29; "skip:' 10": 0.31; 'accomplished': 0.31; 'concern': 0.31; 'int,': 0.31; 'tuples': 0.31; 'class': 0.32; '(including': 0.33; 'not.': 0.33; 'could': 0.34; 'received:66': 0.35; 'received:10': 0.37; 'to:addr :python-list': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'tell': 0.60; 'from:no real name:2**0': 0.61; 'header:Message- Id:1': 0.63; 'to:addr:gmail.com': 0.65; 'benefit': 0.68; 'special': 0.74
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.us; h= message-id:from:to:mime-version:content-transfer-encoding :content-type:in-reply-to:references:subject:date; s=mesmtp; bh= 7ktuCKV9qgtx0iyrgF/yIaEo22E=; b=pGsiLZitjZI/ZsUv2rOAQbq8Lj0h70qd fqVsaGE/1KW9xDpOjATWLNBxIq45Aj2OW53GIjzONgjS0F5wtYg1pV0N1/Vxkbgs t/20Sc84NIzeLkHDqFC/uS8UrJ8vKtiOxilaZ62BCTHmSn+kgtWwLjO8VLbr3MW+ r036Bik6jkw=
DKIM-Signature v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:mime-version :content-transfer-encoding:content-type:in-reply-to:references :subject:date; s=smtpout; bh=7ktuCKV9qgtx0iyrgF/yIaEo22E=; b=TT5 +sHj5ewQ3nFfZhSFsnGBSMJKRn6b+2tCWcXEB7m+kv2y42UYPZdfmnQ/8xChfarE rwgUQD6gfr8kwPk4Srzm63qO7+raU3hP0RV1QozUA6J8+k531qYwgqTmbI793TPp GE/GZJ6x/QmJmJQe0IPbNd6AiN0eqehU3iCDXk5g=
X-Sasl-Enc Ej5hItup1rCYzAiXdxeM291yAKhie+DZ1ZIQqQpGl05E 1384206048
From random832@fastmail.us
To Frank-Rene Schäfer <fschaef@gmail.com>, python-list@python.org
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Content-Type text/plain
X-Mailer MessagingEngine.com Webmail Interface - ajax-d4893488
In-Reply-To <CAB6+5b_w+kBT=EDqd9wRO80am+Wp2DgrEqSpVEPWkcTAVmYQtQ@mail.gmail.com>
References <CAB6+5b_w+kBT=EDqd9wRO80am+Wp2DgrEqSpVEPWkcTAVmYQtQ@mail.gmail.com>
Subject Re: 'isimmutable' and 'ImmutableNester'
Date Mon, 11 Nov 2013 16:40:48 -0500
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2399.1384206051.18130.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384206051 news.xs4all.nl 15972 [2001:888:2000:d::a6]:58508
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59102

Show key headers only | View raw


> A built-in function 'isimmutable()' shall tell efficiently whether the
> object
> of concern is mutable or not.

What's the benefit over attempting to hash() the object?

copy.deepcopy already has special case for int, string, and tuples
(including tuples that do and do not have mutable members) - could what
you need be accomplished by overriding __copy__ and __deepcopy__ in your
custom class to return itself if it is immutable?

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


Thread

Re: 'isimmutable' and 'ImmutableNester' random832@fastmail.us - 2013-11-11 16:40 -0500

csiph-web