4 ms·
I believe that makes them the same as any other class defined with `__slots__`: >>> class Foo: ... __slots__ = ('a', 'b') ... >>> f = Foo()
by joshuamorton 6y ago
I believe that makes them the same as any other class defined with `__slots__`:
>>> class Foo:
... __slots__ = ('a', 'b')
...
>>> f = Foo()
>>> f.a = 1
>>> f.b = 2
>>> f.c = 3
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Foo' object has no attribute 'c'