Skip to content

Update super usage in potentially buggy cases#790

Merged
rahulporuri merged 4 commits into
masterfrom
rahulporuri-patch-2
Apr 21, 2021
Merged

Update super usage in potentially buggy cases#790
rahulporuri merged 4 commits into
masterfrom
rahulporuri-patch-2

Conversation

@rahulporuri
Copy link
Copy Markdown
Contributor

@rahulporuri rahulporuri commented Apr 21, 2021

See related #789

This PR updates a few calls to super that were potentially buggy. In these two cases for example, we were calling super(A, self) from class B where B inherits from A. We first update the super calls to use the correct class argument - and then update the super call to remove the arguments altogether.

Poruri Sai Rahul added 3 commits April 21, 2021 04:26
we were using `super(Container, self)` from inside `Canvas`, which seems like
an unintentional bug
Comment thread enable/canvas.py Outdated
Comment thread enable/text_grid.py Outdated
@rahulporuri rahulporuri changed the title [WIP] Update super usage in potentially buggy cases Apr 21, 2021
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

unittest.TestCase):
def setUp(self):
super(HoverToolTestCase, self).setUp()
GuiTestAssistant.setUp(self)
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.

Same question I had on the other PR, why exactly do we purposefully avoid super for setUp

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.

answered elsewhere - part convention, part best practice - especially because we have cases where we need to call setUp on more than one base class.

@rahulporuri rahulporuri merged commit 381036e into master Apr 21, 2021
@rahulporuri rahulporuri deleted the rahulporuri-patch-2 branch April 21, 2021 13:42
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