Save memory using Python slots.
Python _slots_ are useful for saving memory when you have a large number of small objects whose attributes are known ahead of time. In this video we learn about __slots__, what slots actually are and how they work.
― mCoding with James Murphy (https://mcoding.io)
Source code: https://github.com/mCodingLLC/VideosS...
Slots docs: https://docs.python.org/3/reference/d...
Descriptor docs: https://docs.python.org/3/reference/d...
SUPPORT ME ⭐
---------------------------------------------------
Patreon: / mcoding
Paypal: https://www.paypal.com/donate/?hosted...
Other donations: https://mcoding.io/donate
Top patrons and donors: Jameson, Laura M, Dragos C, Vahnekie, John Martin, Casey G, Pieter G, Krisztian M, Sigmanificient
BE ACTIVE IN MY COMMUNITY 😄
---------------------------------------------------
Discord: / discord
Github: https://github.com/mCodingLLC/
Reddit: / mcoding
Facebook: / james.mcoding
CHAPTERS
---------------------------------------------------
0:00 Intro
0:43 Normal class
1:53 Slots class
2:44 Why use slots
4:21 Slots are descriptors
5:45 What are slots
8:32 Inheritance
9:14 No metaclass slots
9:24 Using a dict slot