Using Magic Methods to Control Attributes in Python
Unusual method implementations to control attributes
4 min readJun 9, 2022
Primer
We can take advantage of magic methods in Python to control attributes that are being set. In this tutorial guide, I present 3 methods using the call, setattr, and a decorator for the init method as unique ways to control how attributes can be set.