Skip to content

Instantly share code, notes, and snippets.

@dboyliao
Created March 23, 2016 16:34
Show Gist options
  • Save dboyliao/0a17c61e7e998ef3ad2c to your computer and use it in GitHub Desktop.
Save dboyliao/0a17c61e7e998ef3ad2c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
class ParentA(object):
def __init__(self):
self.a = "parent a"
class ParentB(object):
def __init__(self):
self.b = "parent b"
class Child(ParentA, ParentB): pass
c = Child()
print(c.a)
# >>> "parent a"
# print(c.b)
## >>> AttributeError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment