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
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to