Hi all, I'm wodering how the information hiding in python is ment. As I understand there doesn't exist public / protected / private mechanism, but a '_' and '__' naming convention.
As I figured out there is only public and private possible as speakin in "C++ manner". Are you all happy with it. What does "the zen of python" say to that design? (protected is useless?) class A: def __init__(self): self.__z = 1 self._z = 2 self.z = 3 def _getX(self): return "X" def __getY(self): return "Y" def doAnything(self): print self.__getY() class B(A): def __init__(self): A.__init__(self) print dir (self) >>> b = B() ['_A__getY', '_A__z', '__doc__', '__init__', '__module__', '_getX', '_z', 'doAnything', 'z'] I was a bit surprised about '_A__getY' and '_A__z'. What would you say to a C++ Programmer about class interfaces in big Python systems? What is the idea behind the _ and __ naming. Use or don't use '_' methods ? (As Designer of the software, as Programmer of the software) Regards Alexander -- http://mail.python.org/mailman/listinfo/python-list