Here is the code:
class Duck():
def __init__(self,input_name):
self.__name = input_name
@property
def name(self):
print('inside the getter')
return self.__name
@name.setter
def name(self):
print('inside the setter')
self.__name = input_name
fowl = Duck("Howard")
So, "dot" is the connection between object and method. That's to say, type fowl.name will get "Howard", because the object called name and returned self.__name.
My question is if I type fowl.name = "cat", why I won't get anything from @property, getter. And how the program knew it's a setter? Because I used "="?