File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,11 @@ class TraitError(Exception):
170
170
171
171
172
172
def isidentifier (s : t .Any ) -> bool :
173
+ warn (
174
+ "traitlets.traitlets.isidentifier(s) is deprecated since traitlets 5.14.4 Use `s.isidentifier()`." ,
175
+ DeprecationWarning ,
176
+ stacklevel = 2 ,
177
+ )
173
178
return t .cast (bool , s .isidentifier ())
174
179
175
180
@@ -3025,7 +3030,7 @@ class ObjectName(TraitType[str, str]):
3025
3030
def validate (self , obj : t .Any , value : t .Any ) -> str :
3026
3031
value = self .coerce_str (obj , value )
3027
3032
3028
- if isinstance (value , str ) and isidentifier (value ):
3033
+ if isinstance (value , str ) and value . isidentifier ():
3029
3034
return value
3030
3035
self .error (obj , value )
3031
3036
@@ -3041,7 +3046,7 @@ class DottedObjectName(ObjectName):
3041
3046
def validate (self , obj : t .Any , value : t .Any ) -> str :
3042
3047
value = self .coerce_str (obj , value )
3043
3048
3044
- if isinstance (value , str ) and all (isidentifier (a ) for a in value .split ("." )):
3049
+ if isinstance (value , str ) and all (a . isidentifier () for a in value .split ("." )):
3045
3050
return value
3046
3051
self .error (obj , value )
3047
3052
You can’t perform that action at this time.
0 commit comments