I have been programming OOP concepts mostly in Java and C++, and recently I have come to use Python. For what I know Python does not necessarly has private variables in their classes, so a programmer can access them directly. For example if I have:
class Whatever:
#constructor
def __init__(self,x):
self.x=x
so a programmer can easily modify the value of x like doing this:
w=Whatever(4)
w.x=6
in this point I was wondering if it would be really necessary to use a setter method like:
setW(self,x)
self.x=x
is it not the last one a redundancy on the code? I have seen some Python books that strive to do that, but for me it seems pointless, is it necessary?