property python classes decorator code example
Example: python property decorator
@property decorator is a built-in decorator in Python which is helpful in defining the properties effortlessly without manually calling the inbuilt function property(). Which is used to return the property attributes of a class from the stated getter, setter and deleter as parameters.
class Student:
def __init__(self, name):
self.__name = name
@property
def name(self):
return self.__name