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.

classification
Title: Programming FAQ about "How do I call a method defined in a base class from a derived class that overrides it?" should mention the no-arguments-version of `super`
Type: enhancement Stage:
Components: Documentation Versions: Python 3.9, Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Dominik V., docs@python
Priority: normal Keywords:

Created on 2020-04-20 21:15 by Dominik V., last changed 2022-04-11 14:59 by admin.

Messages (1)
msg366884 - (view) Author: Dominik Vilsmeier (Dominik V.) * Date: 2020-04-20 21:15
Right now it contains the following example:

    class Derived(Base):
        def meth(self):
            super(Derived, self).meth()

`super()` without arguments is beneficial for multiple reasons, so it should be used in the example.

Also the paragraph speaks about versions prior 3.0 which seems strange because

1. the page is served at https://docs.python.org/3/faq/programming.html i.e. corresponding to version Python 3
2. Python 2 maintenance has been finally dropped.

The provided example is still useful though, for example in multiple inheritance scenarios (though these are very specific and `super()` of course also works if base classes are compatible). So perhaps it's better left out?
History
Date User Action Args
2022-04-11 14:59:29adminsetgithub: 84523
2020-04-20 21:15:44Dominik V.create