Last active
December 20, 2015 15:39
-
-
Save maizy/6155816 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python 2.6, 2.7, ... 3.3 ... | |
def __a(p): | |
print('a ' + p) | |
class A(object): | |
def __b(self): | |
print('A.__b') | |
def do(self): | |
self.__b() | |
#__a(134) # wtf? _A__a() | |
def _B__a(): | |
print('oh shit! that\'s python baby!') | |
class B(A): | |
def __b(self): | |
print('B.__b') | |
def do(self): | |
self.__b() | |
super(B, self).do() | |
__a() # wtf? _B__a() | |
if __name__ == '__main__': | |
b1 = B() | |
b1.do() | |
## http://docs.python.org/2/reference/expressions.html#atom-identifiers | |
## http://docs.python.org/3/reference/expressions.html#atom-identifiers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
😭 🙈