Most pythonic way to declare inner functions
There are no private functions in Python. Rather, by prefixing the names of methods intended to be non-public with underscores, you signal to users of your class that those methods are not meant to be called externally:
class Functions:
def main_function1(self):
print("#first function#")
self._helper1()
self._helper2()
def main_function2(self):
print("#second function#")
self._helper1()
self._helper2()
def _helper1(self):
print("first helper")
def _helper2(self):
print("second helper")
This is in line with the principle of "We're all consenting adults here" - you can touch the non-public methods of a class, but if you use them wrongly, that's on your own head.