On Fri, Apr 24, 2020 at 4:16 PM Cecil Westerhof <ce...@decebal.nl> wrote: > > issubclass(bool, int) gives True > but > super(bool) gives <super: bool, None> > > Do I not understand the meaning of super, or is this inconsistent? > > (Until now I have not down much work with classes in Python.) >
One-arg super is an unbound object, and the "None" just indicates that. (Although every Python that I've tried says NULL there, not None. What version are you using?) It doesn't say what "the parent class" is, because super doesn't actually work with parent classes - it lets you call the *next* class. (In complex inheritance trees, that can mean going across a diamond or anything.) I've never actually looked at the repr of a super object - I've always just called a method on it immediately after constructing it. Never seen a need to hang onto one :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list