Are there disadvantages of using __slots__?
Are there disadvantages of using __slots__? Question: I’m using Python 3.7 and Django. I was reading about __slots__ . Evidently, __slots__ can be used to optimize memory allocation for a large number of those objects by listing all the object properties ahead of time. class MyClass(object): __slots__ = [‘name’, ‘identifier’] def __init__(self, name, identifier): self.name …