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


Groups > comp.lang.python > #59102 > unrolled thread

Re: 'isimmutable' and 'ImmutableNester'

Started byrandom832@fastmail.us
First post2013-11-11 16:40 -0500
Last post2013-11-11 16:40 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#59102 — Re: 'isimmutable' and 'ImmutableNester'

Fromrandom832@fastmail.us
Date2013-11-11 16:40 -0500
SubjectRe: 'isimmutable' and 'ImmutableNester'
Message-ID<mailman.2399.1384206051.18130.python-list@python.org>
> 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?

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web