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
| self.redirectStdin(False) | ||
| builtins.raw_input = self.raw_input | ||
| self.destroy() | ||
| super(PyShellBase, self).Destroy() |
There was a problem hiding this comment.
This is a potentially buggy use of super
There was a problem hiding this comment.
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.
we removed this redundant redefinition of __init__
| self.redirectStdin(False) | ||
| builtins.raw_input = self.raw_input | ||
| self.destroy() | ||
| super(PyShellBase, self).Destroy() |
There was a problem hiding this comment.
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
superusage in a semi-automated fashion. We used regex-based search and replace to update thesuperusage. Note that there was one instance where asuperwas 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