News for hackers. Stuff that matters.
Re:Object Oriented Programming in Python: Encapsulation and ... by eire1130 on Sunday September 24, 2017 @12:43PM (#15325415)
Sure, but I think this is what the author is getting at:

  >>> class A:
  ...     def __a(self,b):
  ...         return b
  ...
  >>> A()
  <__main__.A object at 0x0000024EE5B0EBE0>
  >>> A().__a('b')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  AttributeError: 'A' object has no attribute '__a'
  >>> a=A()
  >>> dir(a)
  ['_A__a', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', 
  '__init__', '__init_subclass__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', 
  '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
  >>> a._A__a("b")
  'b'
In practice, I have never seen this used and just confuses things - and for dev's coming from Java / C++ or some other language it tends to just confuse things.
Re:Object Oriented Programming in Python: Encapsulation and ... by masklinn on Sunday September 24, 2017 @01:00PM (#15325487)
Name mangling was never intended as a way to make variables private (or pseudo-private) but as a way to avoid conflicts when designing for inheritance.
Re:Object Oriented Programming in Python: Encapsulation and ... by Walkman on Monday September 25, 2017 @03:47PM (#15333463)
Exactly!