Start using slotted classes

https://book.pythontips.com/en/latest/__slots__magic.html

__slots__ is powerful. It saves a lot of RAM overhead while loading classes. Let’s also use them in frappe classes.

However, for this to work, we’ll have to let go of __dict__ usage in out code.

Exploring a bit, it seems lots of familiar Python 3+ packages use them gunicorn, IPython, Jinja2, dateutil, werkzeug, git, pandas

frappe@ubuntu1804lts:~/frappe-bench$ find . -name ‘*.py’ | xargs grep ‘__slots__’

So the idea is ‘slots tell Python not to use a dict, and only allocate space for a fixed set of object instance attributes’