@@ -392,7 +392,7 @@ def contains(self, mouseevent):
392392 selection, such as which points are contained in the pick radius. See
393393 individual artists for details.
394394 """
395- if six . callable (self ._contains ):
395+ if callable (self ._contains ):
396396 return self ._contains (self , mouseevent )
397397 warnings .warn ("'%s' needs 'contains' method" % self .__class__ .__name__ )
398398 return False , {}
@@ -435,7 +435,7 @@ def pick(self, mouseevent):
435435 # Pick self
436436 if self .pickable ():
437437 picker = self .get_picker ()
438- if six . callable ( picker ) :
438+ if picker is not None :
439439 inside , prop = picker (self , mouseevent )
440440 else :
441441 inside , prop = self .contains (mouseevent )
@@ -446,8 +446,8 @@ def pick(self, mouseevent):
446446 for a in self .get_children ():
447447 # make sure the event happened in the same axes
448448 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 ) :
451451 # we need to check if mouseevent.inaxes is None
452452 # because some objects associated with an axes (e.g., a
453453 # tick label) can be outside the bounding box of the
@@ -873,7 +873,7 @@ def _update_property(self, k, v):
873873 return setattr (self , k , v )
874874 else :
875875 func = getattr (self , 'set_' + k , None )
876- if func is None or not six . callable (func ):
876+ if not callable (func ):
877877 raise AttributeError ('Unknown property %s' % k )
878878 return func (v )
879879
@@ -1075,7 +1075,7 @@ def matchfunc(x):
10751075 elif cbook .issubclass_safe (match , Artist ):
10761076 def matchfunc (x ):
10771077 return isinstance (x , match )
1078- elif six . callable (match ):
1078+ elif callable (match ):
10791079 matchfunc = match
10801080 else :
10811081 raise ValueError ('match must be None, a matplotlib.artist.Artist '
@@ -1166,9 +1166,9 @@ def get_aliases(self):
11661166 }
11671167
11681168 """
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 ))]
11721172 aliases = {}
11731173 for name in names :
11741174 func = getattr (self .o , name )
@@ -1222,17 +1222,14 @@ def _get_setters_and_targets(self):
12221222 for name in dir (self .o ):
12231223 if not name .startswith ('set_' ):
12241224 continue
1225- o = getattr (self .o , name )
1226- if not six . callable (o ):
1225+ func = getattr (self .o , name )
1226+ if not callable (func ):
12271227 continue
12281228 if six .PY2 :
1229- nargs = len (inspect .getargspec (o )[0 ])
1229+ nargs = len (inspect .getargspec (func )[0 ])
12301230 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 ):
12361233 continue
12371234 source_class = self .o .__module__ + "." + self .o .__name__
12381235 for cls in self .o .mro ():
@@ -1371,8 +1368,7 @@ def properties(self):
13711368 """
13721369 o = self .oorig
13731370 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 ))]
13761372 getters .sort ()
13771373 d = dict ()
13781374 for name in getters :
@@ -1432,7 +1428,7 @@ def matchfunc(x):
14321428 elif issubclass (match , Artist ):
14331429 def matchfunc (x ):
14341430 return isinstance (x , match )
1435- elif six . callable (match ):
1431+ elif callable (match ):
14361432 matchfunc = func
14371433 else :
14381434 raise ValueError ('match must be None, a matplotlib.artist.Artist '
0 commit comments