Are instances of user-defined classes mutable?

Ethan Furman ethan at stoneleaf.us
Thu Aug 6 11:15:55 EDT 2020


On 8/6/20 7:40 AM, Robin Becker wrote:
> On 06/08/2020 05:17, ZHAOWANCHENG wrote:

>> So are instances of user-defined classes mutable or immutable?
>
> user class instances are clearly mutable, and in my python 3.8 you can 
> do horrid things like this
 >
 > [snip buggy/incorrect uses of __hash__]

You can do horrid things like that clear back in Python 2, but the fault 
lies with the programmer for misusing the __dunders__.

--
~Ethan~


More information about the Python-list mailing list