I read tons of documents and answers and so far I haven't seen anything that is protecting python class attributes from being modified by clients.
This is one example:
class Dog:
def __init__(self):
self._legs = 4
@property
def legs(self):
return self._legs
@legs.setter
def legs(self, n):
self._legs = 4
No matter we have legs.setter method or not, users can always read or modify the Dog's attribute by _legs internal names. And they can even modify it's value by calling:
dog = Dog()
dog._legs = 3
print(dog.legs)
# output 3
I don't really see how it protected things from being stolen or modified from client side?