Skip to content

Commit afae010

Browse files
committed
fix multiple inheritance example
1 parent 3e1a1dd commit afae010

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Finished/Ch 2/multiple_finished.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
class A:
66
def __init__(self):
77
super().__init__()
8-
self.foo = "foo"
8+
self.prop1 = "prop1"
99
self.name = "Class A"
1010

1111

1212
class B:
1313
def __init__(self):
1414
super().__init__()
15-
self.bar = "bar"
15+
self.prop2 = "prop2"
1616
self.name = "Class B"
1717

1818

@@ -21,12 +21,12 @@ def __init__(self):
2121
super().__init__()
2222

2323
def showprops(self):
24-
print(self.foo)
25-
print(self.bar)
24+
print(self.prop1)
25+
print(self.prop2)
2626
print(self.name)
2727

2828

29-
# create the class and call showname()
29+
# create the class and call showprops()
3030
c = C()
3131
print(C.__mro__)
3232
c.showprops()

Start/Ch 2/multiple_start.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
class A:
66
def __init__(self):
77
super().__init__()
8-
self.foo = "foo"
8+
self.prop1 = "prop1"
99

1010

1111
class B:
1212
def __init__(self):
1313
super().__init__()
14-
self.bar = "bar"
14+
self.prop2 = "prop2"
1515

1616

1717
class C(A, B):

0 commit comments

Comments
 (0)