
July 28, 2017
8 a.m.
On 2017-07-27 18:02, Chris Angelico wrote:
As Ivan said, this is to do with __slots__. It's nothing to do with immutability:
object().__slots__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'object' object has no attribute '__slots__'
object().__dict__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'object' object has no attribute '__dict__'
If an object has no slots or dict and does not accept attribute assignment, is it not effectively immutable? -Mike