Created
December 9, 2014 20:20
-
-
Save gergob/93e1148c43d298be88ad to your computer and use it in GitHub Desktop.
MRO Type Error
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) | |
class Tablet(Computer,Phone): | |
def __init__(self): | |
Computer.__init__(self) | |
Phone.__init__(self) | |
class Phablet(SmartPhone,Tablet): | |
def __init__(self): | |
SmartPhone.__init__(self) | |
Tablet.__init__(self) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment