Understanding Getters and Setters in Python

An introduction to getters and setters in Python

George Pipis

--

Photo by Bernd 📷 Dittrich on Unsplash

In object-oriented programming, encapsulation is one of the fundamental principles, used to bundle the data (attributes) and methods (functions) that operate on the data into a single unit or class. It also restricts direct access to some of an object’s components, which can prevent the accidental…

--

--

George Pipis

Sr. Director, Data Scientist @ Persado | Co-founder of the Data Science blog: https://predictivehacks.com/