I agree it’s abstract and obscure, and you’ll notice I only use it temporarily as I build towards the final solutions (see also Parts 3-7 that are in the follow up post), which no longer use this. As with all dunder attributes, they’re not meant to be used directly!
The reason I show this is to demonstrate what happens behind the scenes for those who are curious to know a bit on how this is implemented in Python (CPython).
Personally, I’m always curious to peek behind the scenes as it helps me understand better what’s happening. So I tend to include these “behind the scenes” when writing, too.
But yes, this is not a solution you want to use in your actual code!
I agree it’s abstract and obscure, and you’ll notice I only use it temporarily as I build towards the final solutions (see also Parts 3-7 that are in the follow up post), which no longer use this. As with all dunder attributes, they’re not meant to be used directly!
The reason I show this is to demonstrate what happens behind the scenes for those who are curious to know a bit on how this is implemented in Python (CPython).
Personally, I’m always curious to peek behind the scenes as it helps me understand better what’s happening. So I tend to include these “behind the scenes” when writing, too.
But yes, this is not a solution you want to use in your actual code!