Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #84523

Open
Dominik1123 mannequin opened this issue Apr 20, 2020 · 2 comments
Labels
3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@Dominik1123
Copy link
Mannequin

Dominik1123 mannequin commented Apr 20, 2020

BPO 40343
Nosy @Dominik1123

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2020-04-20.21:15:44.708>
labels = ['type-feature', '3.8', '3.9', 'docs']
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`'
updated_at = <Date 2020-04-20.21:15:44.708>
user = 'https://github.com/Dominik1123'

bugs.python.org fields:

activity = <Date 2020-04-20.21:15:44.708>
actor = 'Dominik V.'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2020-04-20.21:15:44.708>
creator = 'Dominik V.'
dependencies = []
files = []
hgrepos = []
issue_num = 40343
keywords = []
message_count = 1.0
messages = ['366884']
nosy_count = 2.0
nosy_names = ['docs@python', 'Dominik V.']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue40343'
versions = ['Python 3.8', 'Python 3.9']

@Dominik1123
Copy link
Mannequin Author

Dominik1123 mannequin commented Apr 20, 2020

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?

@Dominik1123 Dominik1123 mannequin added 3.8 only security fixes 3.9 only security fixes labels Apr 20, 2020
@Dominik1123 Dominik1123 mannequin assigned docspython Apr 20, 2020
@Dominik1123 Dominik1123 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.8 only security fixes 3.9 only security fixes labels Apr 20, 2020
@Dominik1123 Dominik1123 mannequin assigned docspython Apr 20, 2020
@Dominik1123 Dominik1123 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Apr 20, 2020
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@bfahr
Copy link

bfahr commented Apr 18, 2024

@Dominik1123 I believe this was fixed in the 3.10 release. It was as you described it in 3.9 but 3.10 makes your recommended change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 only security fixes 3.9 only security fixes docs Documentation in the Doc dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant