I have a class definition with two methods defined in it. The layout somewhat looks like below:
class Sample:
def calling-Method(self):
print "Hi"
calledMethod()
def called-Method(self):
print "How are you"
I want called-Mehtod(self)
should not be called from outside the class.
The following should NOT be possible :
if __name__ == "__main__":
obj = Sample()
obj.called-Method() #This should not allowed.
I researched and found out that python is not meant for privacy. Alternative is to use double underscore ("__") but this is not for privacy.
Is there any way to exhibit privacy in above scenario ? Any help is highly appreciated..