A super() print will give you the whole super object reference:
So if a cube is a child of a square, if you call super() within cube youâll get:
<super: <class 'Cube'>, <Cube object>>
instead of square. But it doesnât mean that itâs referring to the cube.
To refer to the object directly you just have to type itâs name. I think the first example in the link I referenced talks about this.
As for the line about transposition, Iâm talking about the DRY principle (donât repeat yourself). If you have a code that can be written to apply to multiple situations, itâs better to write it that way than specifically for each situation.
For example, if I wanted to refer to super() in multiple classes, itâs better to use super() than to type the different names of all the super() references in each class. The benefit to do this is that in the future the class changes but has the same structure, the code wonât need to be adjusted. There may be cases where this is not necessary, or suggested, but they donât come to mind right now.
@dev6112515278 yes thatâs right. Python might not be a perfect language. But then again, what language is? I do appreciate that they try to maintain it in tidy shape. And thereâs no shortage of knowledgeable people to clarify its more obscure areas.