What is the difference between super() with arguments and without arguments?

In Python-3.x you generally don’t need the arguments for super anymore. That’s because they are inserted magically (see PEP 3135 — New Super).

The two argument call and the no-argument call are identical if:

  • The first argument is the class in which the method is defined that uses super. In your case it’s Ball so the condition is satisfied.
  • and the second argument to super is the first argument of the method. In your case that’s self which is the first argument of the method so that condition is also satisfied.

So in your case there’s no difference between the two examples!


However there are some rare cases in which you actually need to call super with different arguments (either with 1 or 2 argument/-s). The documentation of super is a good starting point:

>>> help(super)
Help on class super in module builtins:

class super(object)
 |  super() -> same as super(__class__, <first argument>)
 |  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)
 |  Typical use to call a cooperative superclass method:

But I assume your question was mostly about the difference in your example (where there is no difference) and these super calls that require arguments are very rare and quite an advanced topic, so I’ll leave them out of this answer.

However there are some resources that might help if you’re interested in the differences:

  • Which of the 4 ways to call super() in Python 3 to use?
  • How can I use super() with one argument in python

Leave a Comment