So I was looking at a certain class which has the following property function. However, the property method itself doesn't describe the procedure but instead calls another function to do so as follows:
class Foo():
@property
def params(self):
return self._params()
@property
def target(self):
return self._target()
def _params(self):
return print("hello")
def _target(self):
return print("world")
What I am trying to understand if it is some sort of pattern? I have seen a similar thing in another class as well where the method with property decorator simply calls another method of same name with underscore in the beginning. Note: I do know what is property decorator but don't understand why this specific way of underscoring aims to achieve.