Created
December 8, 2014 05:42
-
-
Save gergob/89979bb7d8584694fbcd to your computer and use it in GitHub Desktop.
multiple_inheritance_manual_constructor
This file contains 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
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