Skip to content

Instantly share code, notes, and snippets.

@maizy
Last active December 20, 2015 15:39
Show Gist options
  • Save maizy/6155816 to your computer and use it in GitHub Desktop.
Save maizy/6155816 to your computer and use it in GitHub Desktop.
# 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
@maizy
Copy link
Author

maizy commented Aug 5, 2013

😭 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment