'isimmutable' and 'ImmutableNester'

random832 at fastmail.us random832 at fastmail.us
Tue Nov 12 10:48:50 EST 2013


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.



More information about the Python-list mailing list