Slots are writable by default:
>>> class A: __slots__ = ('x',)
...
>>> list(vars(A))
['__module__', '__slots__', 'x', '__doc__']
>>> vars(A)['x']
<member 'x' of 'A' objects>
>>> a = A()
>>> a.x = 'foo'
>>> del a.x
How to create read-only slots, like the slots '__thisclass__' , '__self__', and '__self_class__' of the class super?
>>> list(vars(super))
['__repr__', '__getattribute__', '__get__', '__init__', '__new__',
'__thisclass__', '__self__', '__self_class__', '__doc__']
>>> vars(super)['__thisclass__']
<member '__thisclass__' of 'super' objects>
>>> s = super(int, 123)
>>> s.__thisclass__ = float
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: readonly attribute
>>> del s.__thisclass__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: readonly attribute