'isimmutable' and 'ImmutableNester'

random832 at fastmail.us random832 at fastmail.us
Mon Nov 11 16:40:48 EST 2013


> 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?



More information about the Python-list mailing list