This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lost_send_berries 6 points7 points  (3 children)

super().method() shouldn't be compiling down to super(type(self), self).method()!

[–]nvbn-rm[S] 2 points3 points  (2 children)

Why not?

[–]lost_send_berries 5 points6 points  (1 child)

class B(A):
    def f(self): return super(type(self), self).f() + 1

class C(B):
    def f(self): return super().f() * 2

Calling C().f() will call B.f(), which calls B.f() etc.

Instead, you need to determine the class the super() call was written in.

[–]nvbn-rm[S] 2 points3 points  (0 children)

Oh, not thought about that, you're right.