-
Notifications
You must be signed in to change notification settings - Fork 55
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
Update super usage in the "wx" and "null" backends #945
Conversation
This commit updates the super usage in a semi-automated way. We used regex-based searcn and replace to update the super usage. Note that in one instance, we fixed a potentially buggy usage of super and in another we removed a redundant usage of super
@@ -309,7 +309,7 @@ def Destroy(self): | |||
self.redirectStdin(False) | |||
builtins.raw_input = self.raw_input | |||
self.destroy() | |||
super(PyShellBase, self).Destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a potentially buggy use of super
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strange as I believe PyShellBase
only has a destroy
method not a Destroy
method:
https://wxpython.org/Phoenix/docs/html/wx.py.shell.Shell.html#wx.py.shell.Shell.destroy
Actually Destroy
is defined much further up the inheritance tree: https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.Destroy
# ------------------------------------------------------------------------ | ||
# 'object' interface. | ||
# ------------------------------------------------------------------------ | ||
def __init__(self, **traits): | ||
""" Create a SimpleGridModel object. """ | ||
|
||
# Base class constructor | ||
super(SimpleGridModel, self).__init__(**traits) | ||
|
||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we removed this redundant redefinition of __init__
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -309,7 +309,7 @@ def Destroy(self): | |||
self.redirectStdin(False) | |||
builtins.raw_input = self.raw_input | |||
self.destroy() | |||
super(PyShellBase, self).Destroy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is strange as I believe PyShellBase
only has a destroy
method not a Destroy
method:
https://wxpython.org/Phoenix/docs/html/wx.py.shell.Shell.html#wx.py.shell.Shell.destroy
Actually Destroy
is defined much further up the inheritance tree: https://wxpython.org/Phoenix/docs/html/wx.Window.html#wx.Window.Destroy
This PR updates
super
usage in a semi-automated fashion. We used regex-based search and replace to update thesuper
usage. Note that there was one instance where asuper
was being called with the wrong arguments - which got fixed in this PR and a redundant redefinition of__init__
which got removed.See similar PR #944 and enthought/traits#1280