Разрешены дефисы в качестве переменных для slots . Если так, то почему?
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
In[14]: class Foo(object):
...: __slots__ = ('xxx-xxx',)
...:
Traceback (most recent call last):
File "/opt/anaconda3-2019.03/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-14-fb51d0b2d90c>", line 1, in <module>
class Foo(object):
TypeError: __slots__ must be identifiers