Андрей Светлов
You need nothing else
Тести не проходять з __slots__ ;)
Якщо додати __slots__ цей тест буде проходити:
>>> x = Persistent()
>>> x.bar = 1
Traceback (most recent call last):
...
AttributeError: 'Persistent' object has no attribute 'bar'
Зате це не буде:
>>> x = Persistent()
>>> print x.__getstate__()
None
В інтерфейсі написано таке:
"If the object has assigned slots, then a two-element tuple is returned. \n"
"The first element is either None or a copy of the instance dictionary, \n"
"The second element is a dictionary with items \n"
"for each of the assigned slots.\n"