I’m trying to hide a class method if the class method is used from outside. I have a
function A that does something and function B that uses A to do something else. E.g.:
class Some_Class:
def funcA():
do something
def funcB():
use funcA to do this
I want funcA()
to be not visible. If I make funcA protected: def __funcA():
, fine, it can’t
be accessed from outside, but then funcB()
does not execute because it needs funcA()
.
Further, funcA()
can still be seen from the outside, even if it’s protected the outside can still
see that “it’s there”. Is there a way to hide it? so that to the outside doesn’t know about it?
Why I want this is just that funcA()
is unnecessary information to the outside.
What I can do is just bring funcA()
outside the class, but is there a way to do it and keep it in
the class?
Follow up: I tried also to make it private with “single underscore” def _funcA():
but that doesn’t even seem to do anything.