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

Update super usage in the "wx" and "null" backends #945

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

rahulporuri
Copy link
Contributor

@rahulporuri rahulporuri commented Jun 14, 2021

This PR updates super usage in a semi-automated fashion. We used regex-based search and replace to update the super usage. Note that there was one instance where a super 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

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()
Copy link
Contributor Author

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

Copy link
Contributor

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

Comment on lines -40 to -49
# ------------------------------------------------------------------------
# 'object' interface.
# ------------------------------------------------------------------------
def __init__(self, **traits):
""" Create a SimpleGridModel object. """

# Base class constructor
super(SimpleGridModel, self).__init__(**traits)

return
Copy link
Contributor Author

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__

Copy link
Contributor

@aaronayres35 aaronayres35 left a 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()
Copy link
Contributor

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

@rahulporuri rahulporuri merged commit ce5e73d into master Jun 14, 2021
@rahulporuri rahulporuri deleted the update-super-usage-wx-toolkit branch June 14, 2021 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants