from fractions import Fraction
class F1(Fraction):
def __init__(self, *args, **kwargs):
Fraction.__init__(*args, **kwargs)
class F2(Fraction):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
Fraction(1, 10) # Fraction(1, 10)
F1(1, 10) # F1(1, 10)
F2(1, 10) # TypeError: object.__init__() takes exactly one argument (the instance to initialize)
How does this happen? Could someone elaborate a bit on the super function?
Python version: 3.8.10