Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4db6f80

Browse filesBrowse files
committed
Remove unneeded delayed super-inits.
These were only needed back when axes_enter_events were generated in the LocationEvent constructor, but this is now done by a standard callback.
1 parent e29b853 commit 4db6f80
Copy full SHA for 4db6f80

File tree

Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-6
lines changed

‎lib/matplotlib/backend_bases.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_bases.py
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,7 @@ def on_press(event):
14061406

14071407
def __init__(self, name, canvas, x, y, button=None, key=None,
14081408
step=0, dblclick=False, guiEvent=None):
1409+
super().__init__(name, canvas, x, y, guiEvent=guiEvent)
14091410
if button in MouseButton.__members__.values():
14101411
button = MouseButton(button)
14111412
if name == "scroll_event" and button is None:
@@ -1418,10 +1419,6 @@ def __init__(self, name, canvas, x, y, button=None, key=None,
14181419
self.step = step
14191420
self.dblclick = dblclick
14201421

1421-
# super-init is deferred to the end because it calls back on
1422-
# 'axes_enter_event', which requires a fully initialized event.
1423-
super().__init__(name, canvas, x, y, guiEvent=guiEvent)
1424-
14251422
def _process(self):
14261423
if self.name == "button_press_event":
14271424
self.canvas._button = self.button
@@ -1522,9 +1519,8 @@ def on_key(event):
15221519
"""
15231520

15241521
def __init__(self, name, canvas, key, x=0, y=0, guiEvent=None):
1525-
self.key = key
1526-
# super-init deferred to the end: callback errors if called before
15271522
super().__init__(name, canvas, x, y, guiEvent=guiEvent)
1523+
self.key = key
15281524

15291525
def _process(self):
15301526
if self.name == "key_press_event":

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.