[doc] Teach 0-args form of super in Programming FAQ#22176
[doc] Teach 0-args form of super in Programming FAQ#22176rhettinger merged 5 commits intopython:masterfrom
Conversation
|
This change looks good. While you're at it, the rest of the entry can be fixed up. In the title, replace "override" with "extend". Also the text paragraph that follows needs to be revised. |
|
@rhettinger had doubts about removing the mention to classic classes, you think that's alright? OtherwIse, I'm not sure what you meant by revising the folllowing paragraph, sorry. |
|
If you are talking about the next question ("How can I organize my code to make it easier to change the base class? |
|
I would remove the entire paragraph that starts with "For version prior to 3.0, you may be using classic classes". That is no longer relevant. Perhaps replace the paragraph with an explanation of what the zero-arg form of super() is actually doing. It figures out the self argument which it uses to derive the MRO. Then it figures out that the current class is Derived and uses that information to determine where in the MRO to start seaching. |
|
@rhettinger I have made the suggested changes |
Teach simpler and more maintainable use of super.