Tag: slots

Understand __slots__ in Python
Post

Understand __slots__ in Python

Originally posted on towardsdatascience. A simple way to improve your Python code When we create an object from a class, the attributes of the object will be stored in a dictionary called __dict__. We use this dictionary to get and set attributes. It allows us to dynamically create new attributes after the creation of the object....