Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #59102
| From | random832@fastmail.us |
|---|---|
| References | <CAB6+5b_w+kBT=EDqd9wRO80am+Wp2DgrEqSpVEPWkcTAVmYQtQ@mail.gmail.com> |
| Subject | Re: 'isimmutable' and 'ImmutableNester' |
| Date | 2013-11-11 16:40 -0500 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2399.1384206051.18130.python-list@python.org> (permalink) |
> 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?
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: 'isimmutable' and 'ImmutableNester' random832@fastmail.us - 2013-11-11 16:40 -0500
csiph-web