I know python functions are virtual by default. Let\'s say I have this:
class Foo:
def __init__(self, args):
do some stuff
def goo():
Since Python has monkey patching, not only can you not make anything "private". Even if you could, someone could still monkeypatch in a new version of the method function.
You can use this kind of name as a "don't go near" warning.
class Foo( object ):
def _roo( self ):
"""Change this at your own risk."""
That's the usual approach. Everyone can read your source. They were warned. If they boldly go where they were warned not to go, they get what they deserve. It doesn't work and you can't help them.
You can try to make this intentionally obcure with inner classes and "hidden" implementation modules that are called by the "private" methods. But... everyone has your source. You can't prevent anything. You can only advise people of the consequences of their actions.