Replaced some instances of ClassName.method with super().method.#5799
Replaced some instances of ClassName.method with super().method.#5799atombrella wants to merge 1 commit into
Conversation
7518ec6 to
b7fd623
Compare
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Please open an issue on the bug tracker for discussion. Or even two issues, because different modules have different maintainers, and the changes should be reviewed and merged separately.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
This PR is linked from bpo-31853. |
tiran
left a comment
There was a problem hiding this comment.
Don't recycle an unrelated and already closed ticket
|
Atombrella, I think you're proceeding under that false assumption that using super() if always or often better than direct parent class references. Python's super() is complicated (and not very fast). It would be easy to accidentally introduce behavior changes. Another consideration is that the effects of such changes are hard-to-test because the MRO is controlled by subclasses. That means that in general we cannot know for sure where super() is going to forward it call (because it was designed to support cooperative multiple inheritance). In general, changes from direct parent class references to super() should only be done if there is a known use case and if the current maintainer of a module agrees to the change. |
|
OK. Since the ticket has been marked as "not as a bug", I'll close my close my pull request. Thanks for the detailed descriptions. |
I replaced this pattern in
SSLSocket. It's all over the place in the codebase. I don't know if it merits a single ticket for each area, or just the whole code-base.