super() Parent proxy

Last updated: 2026-09-22

super() Parent proxy

super() returns a proxy to the parent class; lets you call parent implementations from a subclass.

CategoryBuilt-in Functions
KindBuilt-in Function
Python Versionall

📝 Syntax

super([type[, object-or-type]])

⚙️ Parameters

type OptionalThe class; the zero-arg form infers it.(Default:None)
obj OptionalAn instance or class for MRO resolution.(Default:None)

Returns:A proxy to the next class in the MRO; methods can be called through it.

💥 Raises

▶ Example

Edit the code, press Run, and see the result in the output panel:

Output:

A.hello
B.hello
More case studies coming soon — check back later.

❓ FAQ

QWhat does super() do?
AIt calls the same-named parent implementation from a subclass method: super().hello() looks up and calls the hello method of the 'next class' in the MRO.
QWhy must super() be called inside a class method?
AThe zero-argument form automatically infers 'the current class and instance'; calling it outside a class (e.g. in a plain function) raises RuntimeError: super(): no arguments.
QWhen must I write super().__init__()?
AWhen the subclass overrides __init__ and still wants the parent class to perform its initialization; without it the parent's __init__ is not executed (unless the parent is object).
QIn what order does super() find parent classes under multiple inheritance?
AIt follows the MRO (Method Resolution Order). super() is not 'the direct parent' but 'the next class in the MRO', which correctly handles diamond inheritance and avoids calling a parent twice.
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏