Benjamin Peterson <benja...@python.org> added the comment:

This sort of thing is true of any slotted class with class attributes:

>>> class X:
...     __slots__ = ()
...     foo = None
... 
>>> X().foo = "hello"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'X' object attribute 'foo' is read-only

I think what needs to happen is the error message needs to be improved in both 
cases.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12766>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to