I am trying to understand when and how to use super() in Python correctly (either 2.7.x or 3.x)
on >>> help(super)
the interpreter tells me how to call it:
class super(object)
| super(type) -> unbound super object
| super(type, obj) -> bound super object; requires isinstance(obj, type)
| super(type, type2) -> bound super object; requires issubclass(type2, type)
I understand that in Python3.x it's now possible to juse use super() within a class definition, but I don't understand why super(obj)
is not possible. Or super(self)
within a class definition.
I know there must be a reason for it, but I can't find it. To me those lines are equivalent to super(obj.__class__, obj)
or super(self.__class__, self)
and those would work right?
I would think that just typing super(obj)
would be a nice shortcut even in Python 3.x.