Super Class
Most Tutorials Call super()
a Function But It’s Actually a Class¶
Many tutorials explain how to use super()
and highlight its benefits, but they often use imprecise terminology. For example:
- 🔹 DigitalOcean refers to it as the
super()
function - 🔹 GeeksforGeeks also calls it a super() function
- 🔹 Real Python casually uses the same term in its explanations
These descriptions aren't technically wrong in terms of simplicity, but they can be misleading.
What Does Python Itself Say?¶
The official Python documentation and the source code of CPython treat super
as a built-in class.
super()
acts like a function call, but behind the scenes, you are instantiating the super class that returns a proxy object
Proof: super
is a Class (CPython Source)¶
Below is the actual implementation of super
in CPython, written in C. This makes it crystal clear: super
is defined as a PyTypeObject
, which is how Python internally represents classes.
Sources I Believe!¶
- CPython Source: https://github.com/PyDeepOlympus/cPyDeepOlympus/blob/main/Objects/typeobject.c
- Official Documentation: https://docs.python.org/3/library/functions.html#super