1 year ago

#364176

test-img

SwarleyMcBarley

Is python super documentation wrong?

Doc

The python doc says super can be called with the following args.

  1. super(type, obj) -> bound super object; requires isinstance(obj, type)
  2. super(type, type2) -> bound super object; requires issubclass(type2, type)

So the second argument in super has to be either a class to satisfy (1) or a metaclass to satisfy (2)

Test

This code runs eventhough self is neither a class nor a metaclass. So is this a mistake in the doc or am I making a mistake somewhere?

python

documentation

super

0 Answers

Your Answer

Accepted video resources