Advertisement
Guest User

Untitled

a guest
Dec 17th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. In [18]: class B:
  2. ...: def __b(self):
  3. ...: print "asdf"
  4. ...:
  5.  
  6. In [19]: b = B()
  7.  
  8. In [20]: b.__b()
  9. ---------------------------------------------------------------------------
  10. AttributeError Traceback (most recent call last)
  11. <ipython-input-20-1d5710fced7a> in <module>()
  12. ----> 1 b.__b()
  13.  
  14. AttributeError: B instance has no attribute '__b'
  15.  
  16. In [21]: dir(b)
  17. Out[21]: ['_B__b', '__doc__', '__module__']
  18.  
  19. In [22]: b._B__b()
  20. asdf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement