This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: doc search for super().__init__() returns no useful results
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.8
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, rhettinger, softwoehr
Priority: normal Keywords:

Created on 2020-09-26 13:03 by softwoehr, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg377527 - (view) Author: Jack W. (softwoehr) Date: 2020-09-26 13:03
It's oddly difficult to glean from the official documentation the correct syntax for superclass initialization.
msg377540 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-09-26 19:46
The __init__() method isn't a feature of super().  It is a feature of the class being called.
msg377542 - (view) Author: Jack W. (softwoehr) Date: 2020-09-26 20:30
True enough, however, no search I could come up which included the term "super" or "__init__" returned a document near the top of the search which showed how to chain a superclass initializer. This can be confusing, as there are 2 syntaxes for doing this.
msg377543 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-09-26 21:01
The primary documentation for super() is here:

At the bottom it references a guide to using super() that you might find helpful:

The standard library source code has many examples.  In particular, the argparse module makes heavy use of super():

The tutorial provides some light discussion:

There is also an FAQ entry:

There is also extensive coverage on StackOverflow:

Hope you find these links helpful.
msg377555 - (view) Author: Jack W. (softwoehr) Date: 2020-09-27 03:55
Thank you.
Date User Action Args
2022-04-11 14:59:36adminsetgithub: 86031
2020-09-27 19:08:53rhettingersetstatus: open -> closed
stage: resolved
2020-09-27 03:55:25softwoehrsetresolution: works for me
2020-09-27 03:55:10softwoehrsetmessages: + msg377555
2020-09-26 21:01:42rhettingersetmessages: + msg377543
2020-09-26 20:30:50softwoehrsetmessages: + msg377542
2020-09-26 19:46:23rhettingersetnosy: + rhettinger
messages: + msg377540
2020-09-26 13:03:29softwoehrcreate