Feb-04-2024, 06:28 AM
(Feb-02-2024, 09:01 AM)Gribouillis Wrote:(Feb-02-2024, 08:10 AM)akbarza Wrote: but still, i don't know why Python in line 22 goes to child2-form1 .That's because you read the documentation but you don't understand it.
At line 22, python will runsuper(child1, self).form1()
. It means that it will search and call methodform1()
in the part of the__mro__
ofself
that comes afterchild1
. This part of the__mro__
ischild2 -> parent -> object
. As there is a method namedform1()
inchild2
, it is this method that gets called.
hi
in the code there is super().form1() . you said
Quote:At line 22, python will run super(child1, self).form1(). how does Python recognize this argument for super() in that line?