@@ -349,7 +349,7 @@ def __init__(self,
349349 # ----------------------------
350350 # Look for regular expressions
351351 for v in self .values :
352- if v and isinstance (v , six . string_types ) and v [0 ] == '/' and v [- 1 ] == '/' :
352+ if v and isinstance (v , str ) and v [0 ] == '/' and v [- 1 ] == '/' :
353353 # String is a regex with leading and trailing '/' character
354354 regex_str = v [1 :- 1 ]
355355 self .val_regexs .append (re .compile (regex_str ))
@@ -387,7 +387,7 @@ def perform_replacemenet(self, v):
387387 """
388388 Return v with any applicable regex replacements applied
389389 """
390- if isinstance (v , six . string_types ):
390+ if isinstance (v , str ):
391391 for repl_args in self .regex_replacements :
392392 if repl_args :
393393 v = re .sub (repl_args [0 ], repl_args [1 ], v )
@@ -442,7 +442,7 @@ def in_values(self, e):
442442 """
443443 Return whether a value matches one of the enumeration options
444444 """
445- is_str = isinstance (e , six . string_types )
445+ is_str = isinstance (e , str )
446446 for v , regex in zip (self .values , self .val_regexs ):
447447 if is_str and regex :
448448 in_values = fullmatch (regex , e ) is not None
@@ -821,7 +821,7 @@ def validate_coerce(self, v):
821821
822822 # If strict, make sure all elements are strings.
823823 if self .strict :
824- invalid_els = [e for e in v if not isinstance (e , six . string_types )]
824+ invalid_els = [e for e in v if not isinstance (e , str )]
825825 if invalid_els :
826826 self .raise_invalid_elements (invalid_els )
827827
@@ -862,10 +862,10 @@ def validate_coerce(self, v):
862862
863863 else :
864864 if self .strict :
865- if not isinstance (v , six . string_types ):
865+ if not isinstance (v , str ):
866866 self .raise_invalid_val (v )
867867 else :
868- if not isinstance (v , (six . string_types , int , float )):
868+ if not isinstance (v , (str , int , float )):
869869 self .raise_invalid_val (v )
870870
871871 # Convert value to a string
@@ -1061,7 +1061,7 @@ def perform_validate_coerce(v, allow_number=None):
10611061 if isinstance (v , numbers .Number ) and allow_number :
10621062 # If allow_numbers then any number is ok
10631063 return v
1064- elif not isinstance (v , six . string_types ):
1064+ elif not isinstance (v , str ):
10651065 # If not allow_numbers then value must be a string
10661066 return None
10671067 else :
@@ -1183,7 +1183,7 @@ def validate_coerce(self, v):
11831183 pass
11841184 if v is None :
11851185 v_valid = True
1186- elif isinstance (v , six . string_types ):
1186+ elif isinstance (v , str ):
11871187 v_match = [
11881188 el for el in ColorscaleValidator .named_colorscales
11891189 if el .lower () == v .lower ()
@@ -1198,7 +1198,7 @@ def validate_coerce(self, v):
11981198 len (e ) != 2 or
11991199 not isinstance (e [0 ], numbers .Number ) or
12001200 not (0 <= e [0 ] <= 1 ) or
1201- not isinstance (e [1 ], six . string_types ) or
1201+ not isinstance (e [1 ], str ) or
12021202 ColorValidator .perform_validate_coerce (e [1 ]) is None )]
12031203
12041204 if len (invalid_els ) == 0 :
@@ -1294,7 +1294,7 @@ def description(self):
12941294 def validate_coerce (self , v ):
12951295 if v is None :
12961296 pass
1297- elif not isinstance (v , six . string_types ):
1297+ elif not isinstance (v , str ):
12981298 self .raise_invalid_val (v )
12991299 else :
13001300 # match = re.fullmatch(self.regex, v)
@@ -1376,7 +1376,7 @@ def description(self):
13761376 return desc
13771377
13781378 def vc_scalar (self , v ):
1379- if not isinstance (v , six . string_types ):
1379+ if not isinstance (v , str ):
13801380 return None
13811381
13821382 # To be generous we accept flags separated on plus ('+'),
@@ -1617,7 +1617,7 @@ def description(self):
16171617 def validate_coerce (self , v ):
16181618 if v is None :
16191619 pass
1620- elif isinstance (v , six . string_types ):
1620+ elif isinstance (v , str ):
16211621 # Future possibilities:
16221622 # - Detect filesystem system paths and convert to URI
16231623 # - Validate either url or data uri
0 commit comments