Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In [18]: class B:
- ...: def __b(self):
- ...: print "asdf"
- ...:
- In [19]: b = B()
- In [20]: b.__b()
- ---------------------------------------------------------------------------
- AttributeError Traceback (most recent call last)
- <ipython-input-20-1d5710fced7a> in <module>()
- ----> 1 b.__b()
- AttributeError: B instance has no attribute '__b'
- In [21]: dir(b)
- Out[21]: ['_B__b', '__doc__', '__module__']
- In [22]: b._B__b()
- asdf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement