I have various class in a module that execute some operation.
Since all of them require to connect to a remote server to execute these operation, I thought that is not convenient to have a ton of code repeated, so I put the connection part in a function.
Now I would like to make this function available to all the classes in this module, but not visible from outside. How do you do this in Python?
class A(obj):
connect(ip)
class B(obj):
connect(ip)
def connect(self, ip):
# connect to host