@@ -392,7 +392,7 @@ def contains(self, mouseevent):
392
392
selection, such as which points are contained in the pick radius. See
393
393
individual artists for details.
394
394
"""
395
- if six . callable (self ._contains ):
395
+ if callable (self ._contains ):
396
396
return self ._contains (self , mouseevent )
397
397
warnings .warn ("'%s' needs 'contains' method" % self .__class__ .__name__ )
398
398
return False , {}
@@ -435,7 +435,7 @@ def pick(self, mouseevent):
435
435
# Pick self
436
436
if self .pickable ():
437
437
picker = self .get_picker ()
438
- if six . callable ( picker ) :
438
+ if picker is not None :
439
439
inside , prop = picker (self , mouseevent )
440
440
else :
441
441
inside , prop = self .contains (mouseevent )
@@ -446,8 +446,8 @@ def pick(self, mouseevent):
446
446
for a in self .get_children ():
447
447
# make sure the event happened in the same axes
448
448
ax = getattr (a , 'axes' , None )
449
- if mouseevent .inaxes is None or ax is None or \
450
- mouseevent .inaxes == ax :
449
+ if ( mouseevent .inaxes is None or ax is None
450
+ or mouseevent .inaxes == ax ) :
451
451
# we need to check if mouseevent.inaxes is None
452
452
# because some objects associated with an axes (e.g., a
453
453
# tick label) can be outside the bounding box of the
@@ -873,7 +873,7 @@ def _update_property(self, k, v):
873
873
return setattr (self , k , v )
874
874
else :
875
875
func = getattr (self , 'set_' + k , None )
876
- if func is None or not six . callable (func ):
876
+ if not callable (func ):
877
877
raise AttributeError ('Unknown property %s' % k )
878
878
return func (v )
879
879
@@ -1075,7 +1075,7 @@ def matchfunc(x):
1075
1075
elif cbook .issubclass_safe (match , Artist ):
1076
1076
def matchfunc (x ):
1077
1077
return isinstance (x , match )
1078
- elif six . callable (match ):
1078
+ elif callable (match ):
1079
1079
matchfunc = match
1080
1080
else :
1081
1081
raise ValueError ('match must be None, a matplotlib.artist.Artist '
@@ -1166,9 +1166,9 @@ def get_aliases(self):
1166
1166
}
1167
1167
1168
1168
"""
1169
- names = [name for name in dir (self .o ) if
1170
- ( name .startswith ('set_' ) or name . startswith ( 'get_' ))
1171
- and six . callable (getattr (self .o , name ))]
1169
+ names = [name for name in dir (self .o )
1170
+ if name .startswith (( 'set_' , 'get_' ))
1171
+ and callable (getattr (self .o , name ))]
1172
1172
aliases = {}
1173
1173
for name in names :
1174
1174
func = getattr (self .o , name )
@@ -1222,17 +1222,14 @@ def _get_setters_and_targets(self):
1222
1222
for name in dir (self .o ):
1223
1223
if not name .startswith ('set_' ):
1224
1224
continue
1225
- o = getattr (self .o , name )
1226
- if not six . callable (o ):
1225
+ func = getattr (self .o , name )
1226
+ if not callable (func ):
1227
1227
continue
1228
1228
if six .PY2 :
1229
- nargs = len (inspect .getargspec (o )[0 ])
1229
+ nargs = len (inspect .getargspec (func )[0 ])
1230
1230
else :
1231
- nargs = len (inspect .getfullargspec (o )[0 ])
1232
- if nargs < 2 :
1233
- continue
1234
- func = o
1235
- if self .is_alias (func ):
1231
+ nargs = len (inspect .getfullargspec (func )[0 ])
1232
+ if nargs < 2 or self .is_alias (func ):
1236
1233
continue
1237
1234
source_class = self .o .__module__ + "." + self .o .__name__
1238
1235
for cls in self .o .mro ():
@@ -1371,8 +1368,7 @@ def properties(self):
1371
1368
"""
1372
1369
o = self .oorig
1373
1370
getters = [name for name in dir (o )
1374
- if name .startswith ('get_' )
1375
- and six .callable (getattr (o , name ))]
1371
+ if name .startswith ('get_' ) and callable (getattr (o , name ))]
1376
1372
getters .sort ()
1377
1373
d = dict ()
1378
1374
for name in getters :
@@ -1432,7 +1428,7 @@ def matchfunc(x):
1432
1428
elif issubclass (match , Artist ):
1433
1429
def matchfunc (x ):
1434
1430
return isinstance (x , match )
1435
- elif six . callable (match ):
1431
+ elif callable (match ):
1436
1432
matchfunc = func
1437
1433
else :
1438
1434
raise ValueError ('match must be None, a matplotlib.artist.Artist '
0 commit comments