Skip to content

Instantly share code, notes, and snippets.

@sigmavirus24
Created September 21, 2012 20:36
Show Gist options
  • Save sigmavirus24/3763744 to your computer and use it in GitHub Desktop.
Save sigmavirus24/3763744 to your computer and use it in GitHub Desktop.
biberao
class A:
def __init__(self):
self._x = 1
class B(A):
def __init__(self):
self._y = 2
b = B()
print(b._x)
# This will raise an AttributeError
class A(object):
def __init__(self):
self._x = 1
class B(A):
def __init__(self):
super(B, self).__init__()
self._y = 2
b = B()
print(b._x, b._y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment