Make Dot Notation More Powerful in Python
Dot notation offers a simple and elegant way to access and modify the attributes of an instance.
Yet, it is a good programming practice to use the getter and setter method for such purposes. This is because it offers more control over how attributes are accessed/changed.
To leverage both in Python, use the @𝐩𝐫𝐨𝐩𝐞𝐫𝐭𝐲 decorator. As a result, you can use the dot notation and still have explicit control over how attributes are accessed/set.
Share this post on LinkedIn: Post Link.
Find the code for my tips here: GitHub.
I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.