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 potentially buggy cases #790

Merged
merged 4 commits into from
Apr 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion enable/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def _draw_underlay(self, gc, view_bounds=None, mode="default"):
gc.move_to(x, 0)
gc.line_to(x2, 0)
gc.stroke_path()
super(Container, self)._draw_underlay(gc, view_bounds, mode)
super()._draw_underlay(gc, view_bounds, mode)

def _transform_view_bounds(self, view_bounds):
# Overload the parent class's implementation to skip visibility test
Expand Down
2 changes: 1 addition & 1 deletion enable/tests/tools/test_hover_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class GuiTestAssistant(object):
class HoverToolTestCase(EnableTestAssistant, GuiTestAssistant,
unittest.TestCase):
def setUp(self):
super(HoverToolTestCase, self).setUp()
GuiTestAssistant.setUp(self)
Copy link
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
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.

self.component = Component(
position=[LOWER_BOUND, LOWER_BOUND], bounds=[SIZE, SIZE]
)
Expand Down
2 changes: 1 addition & 1 deletion enable/text_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class TextGrid(Component):
# ------------------------------------------------------------------------

def __init__(self, **kwtraits):
super(Component, self).__init__(**kwtraits)
super().__init__(**kwtraits)
self.selected_cells = []

# ------------------------------------------------------------------------
Expand Down