To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit f5939b0b authored by rworreby's avatar rworreby
Browse files

Fix more formatting

parent 8187beb0
......@@ -3023,17 +3023,17 @@ print(y) # [0, 1, [666, 3]]
```python
class A:
def __init__(self):
self.a = 1
def print_A(self):
print(self.a)
def __init__(self):
self.a = 1
def print_A(self):
print(self.a)
class B(A): # B inherits from A
def __init__(self):
super().__init__() # self.a == 1
self.b = 2
def print_B(self):
print(self.b)
def __init__(self):
super().__init__() # self.a == 1
self.b = 2
def print_B(self):
print(self.b)
b = B()
b.print_A() # 1, so print_A is inherited and base class constructor is called to set a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment