File tree Expand file tree Collapse file tree 9 files changed +14
-12
lines changed
Filter options
Expand file tree Collapse file tree 9 files changed +14
-12
lines changed
Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ def contains(self, mouseevent):
402
402
--------
403
403
set_contains, get_contains
404
404
"""
405
- if callable ( self ._contains ) :
405
+ if self ._contains :
406
406
return self ._contains (self , mouseevent )
407
407
_log .warning ("%r needs 'contains' method" , self .__class__ .__name__ )
408
408
return False , {}
@@ -430,6 +430,8 @@ def contains(artist: Artist, event: MouseEvent) -> bool, dict
430
430
implementation of the respective artist, but may provide
431
431
additional information.
432
432
"""
433
+ if not callable (picker ):
434
+ raise TypeError ("picker is not a callable" )
433
435
self ._contains = picker
434
436
435
437
def get_contains (self ):
Original file line number Diff line number Diff line change @@ -4257,7 +4257,7 @@ def get_children(self):
4257
4257
4258
4258
def contains (self , mouseevent ):
4259
4259
# docstring inherited.
4260
- if callable ( self ._contains ) :
4260
+ if self ._contains :
4261
4261
return self ._contains (self , mouseevent )
4262
4262
return self .patch .contains (mouseevent )
4263
4263
Original file line number Diff line number Diff line change @@ -244,7 +244,7 @@ def contains(self, mouseevent):
244
244
This function always returns false. It is more useful to test if the
245
245
axis as a whole contains the mouse rather than the set of tick marks.
246
246
"""
247
- if callable ( self ._contains ) :
247
+ if self ._contains :
248
248
return self ._contains (self , mouseevent )
249
249
return False , {}
250
250
@@ -1781,7 +1781,7 @@ class XAxis(Axis):
1781
1781
def contains (self , mouseevent ):
1782
1782
"""Test whether the mouse event occurred in the x axis.
1783
1783
"""
1784
- if callable ( self ._contains ) :
1784
+ if self ._contains :
1785
1785
return self ._contains (self , mouseevent )
1786
1786
1787
1787
x , y = mouseevent .x , mouseevent .y
@@ -2152,7 +2152,7 @@ def contains(self, mouseevent):
2152
2152
2153
2153
Returns *True* | *False*
2154
2154
"""
2155
- if callable ( self ._contains ) :
2155
+ if self ._contains :
2156
2156
return self ._contains (self , mouseevent )
2157
2157
2158
2158
x , y = mouseevent .x , mouseevent .y
Original file line number Diff line number Diff line change @@ -352,7 +352,7 @@ def contains(self, mouseevent):
352
352
Returns ``bool, dict(ind=itemlist)``, where every item in itemlist
353
353
contains the event.
354
354
"""
355
- if callable ( self ._contains ) :
355
+ if self ._contains :
356
356
return self ._contains (self , mouseevent )
357
357
358
358
if not self .get_visible ():
Original file line number Diff line number Diff line change @@ -658,7 +658,7 @@ def contains(self, mouseevent):
658
658
-------
659
659
bool, {}
660
660
"""
661
- if callable ( self ._contains ) :
661
+ if self ._contains :
662
662
return self ._contains (self , mouseevent )
663
663
inside = self .bbox .contains (mouseevent .x , mouseevent .y )
664
664
return inside , {}
Original file line number Diff line number Diff line change @@ -591,7 +591,7 @@ def contains(self, mouseevent):
591
591
"""
592
592
Test whether the mouse event occurred within the image.
593
593
"""
594
- if callable ( self ._contains ) :
594
+ if self ._contains :
595
595
return self ._contains (self , mouseevent )
596
596
# TODO: make sure this is consistent with patch and patch
597
597
# collection on nonlinear transformed coordinates.
@@ -1291,7 +1291,7 @@ def get_window_extent(self, renderer=None):
1291
1291
1292
1292
def contains (self , mouseevent ):
1293
1293
"""Test whether the mouse event occurred within the image."""
1294
- if callable ( self ._contains ) :
1294
+ if self ._contains :
1295
1295
return self ._contains (self , mouseevent )
1296
1296
1297
1297
if not self .get_visible (): # or self.get_figure()._renderer is None:
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def contains(self, mouseevent, radius=None):
127
127
128
128
Returns T/F, {}
129
129
"""
130
- if callable ( self ._contains ) :
130
+ if self ._contains :
131
131
return self ._contains (self , mouseevent )
132
132
radius = self ._process_radius (radius )
133
133
inside = self .get_path ().contains_point (
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ def _get_grid_bbox(self, renderer):
438
438
439
439
def contains (self , mouseevent ):
440
440
# docstring inherited
441
- if callable ( self ._contains ) :
441
+ if self ._contains :
442
442
return self ._contains (self , mouseevent )
443
443
444
444
# TODO: Return index of the cell containing the cursor so that the user
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ def contains(self, mouseevent):
193
193
-------
194
194
bool : bool
195
195
"""
196
- if callable ( self ._contains ) :
196
+ if self ._contains :
197
197
return self ._contains (self , mouseevent )
198
198
199
199
if not self .get_visible () or self ._renderer is None :
You can’t perform that action at this time.
0 commit comments