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


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

Re: 'isimmutable' and 'ImmutableNester'

Started byChris Angelico <rosuav@gmail.com>
First post2013-11-12 20:44 +1100
Last post2013-11-12 20:44 +1100
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' Chris Angelico <rosuav@gmail.com> - 2013-11-12 20:44 +1100

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

FromChris Angelico <rosuav@gmail.com>
Date2013-11-12 20:44 +1100
SubjectRe: 'isimmutable' and 'ImmutableNester'
Message-ID<mailman.2447.1384249481.18130.python-list@python.org>
On Tue, Nov 12, 2013 at 8:39 PM, Frank-Rene Schäfer <fschaef@gmail.com> wrote:
>> All you've done is proven that you can subvert things. By fiddling
>> with __hash__, __eq__, and so on, you can make sets and dicts behave
>> very oddly. Means nothing.
>
> To the contrary, it means everything about what 'isimmutable' could
> contribute: security against advert or inadvert insertion of mutable objects.

So how do you figure out whether something's immutable or not? Are you
going to ask the object itself? If so, stick with __hash__, and just
follow the rule that mutable objects aren't hashable - which is, if
I'm not mistaken, how things already are. And if not, then how? How
will you know if something has mutator methods?

ChrisA

[toc] | [standalone]


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


csiph-web