I come from the Java world, where you can hide variables and functions and then run unit tests against them using reflection. I have used nested functions to hide implement
The Python convention is to name "private" functions and methods with a leading underscore. When you see a leading underscore, you know not to try and use it.