Skip to content

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

Merged
rahulporuri merged 1 commit into
masterfrom
update-super-usage-wx-toolkit
Jun 14, 2021
Merged

Update super usage in the "wx" and "null" backends#945
rahulporuri merged 1 commit into
masterfrom
update-super-usage-wx-toolkit

Conversation

@rahulporuri
Copy link
Copy Markdown
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
self.redirectStdin(False)
builtins.raw_input = self.raw_input
self.destroy()
super(PyShellBase, self).Destroy()
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

self.redirectStdin(False)
builtins.raw_input = self.raw_input
self.destroy()
super(PyShellBase, self).Destroy()
Copy link
Copy Markdown
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