Skip to content

Instantly share code, notes, and snippets.

@gergob
Created December 8, 2014 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gergob/89979bb7d8584694fbcd to your computer and use it in GitHub Desktop.
Save gergob/89979bb7d8584694fbcd to your computer and use it in GitHub Desktop.
multiple_inheritance_manual_constructor
class Phone(object):
def __init__(self):
print("Phone constructor invoked.")
def call_number(self, phone_number):
print("Calling number {}".format(phone_number))
class Computer(object):
def __init__(self):
print("Computer constructor invoked.")
def install_software(self, software):
print("Computer installing the {} software".format(software))
class SmartPhone(Phone, Computer):
def __init__(self):
Phone.__init__(self)
Computer.__init__(self)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment