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


Groups > comp.lang.python > #59213

Re: 'isimmutable' and 'ImmutableNester'

From random832@fastmail.us
References <CAB6+5b_w+kBT=EDqd9wRO80am+Wp2DgrEqSpVEPWkcTAVmYQtQ@mail.gmail.com> <1384206048.30461.46091021.634F0FCA@webmail.messagingengine.com> <CAB6+5b-V1VkgZPwjwZHiGmxUU9ZWgBE7Cgo4k9eg7GKSaNjw6g@mail.gmail.com>
Subject Re: 'isimmutable' and 'ImmutableNester'
Date 2013-11-12 10:48 -0500
Newsgroups comp.lang.python
Message-ID <mailman.2474.1384271901.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Nov 12, 2013, at 4:39, Frank-Rene Schäfer 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.

If an object can lie about its hashability, it can lie to your function
too... unless you don't intend to provide a way for a _genuinely_
immutable class to say so.

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


Thread

Re: 'isimmutable' and 'ImmutableNester' random832@fastmail.us - 2013-11-12 10:48 -0500

csiph-web