
July 28, 2017
11:23 a.m.
That's a subclass. Also:
class A(list): __slots__ = () ...
a = A() a.foo = 'bar' Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'A' object has no attribute 'foo'
-Mike On 2017-07-28 01:06, Antoine Rozo wrote:
If an object has no slots or dict and does not accept attribute assignment, is it not effectively immutable?
No, not necessarily.
class A(list): __slots__ = ()