What is the Python @property Decorator?

How to use it and when to use it.

Allie Hsu
Python in Plain English
4 min readSep 13, 2021

--

Photo by Tierra Mallorca on Unsplash

Getter and setter are used in many object-oriented programming languages, (click the link for knowing how it works in Java), however, python provides a much easier way to use getter and setter with its built-in @property decorator.

Wait, decorator? Sounds familiar, right? If you haven’t heard of it before, or if…

--

--