106
106
Name or list of names to sort by""" ,
107
107
)
108
108
109
- # sentinel value to use as kwarg in place of None when None has special meaning
110
- # and needs to be distinguished from a user explicitly passing None.
111
- sentinel = object ()
112
-
113
109
114
110
def _single_replace (self , to_replace , method , inplace , limit ):
115
111
"""
@@ -1086,7 +1082,7 @@ def rename(self, *args, **kwargs):
1086
1082
return result .__finalize__ (self )
1087
1083
1088
1084
@rewrite_axis_style_signature ("mapper" , [("copy" , True ), ("inplace" , False )])
1089
- def rename_axis (self , mapper = sentinel , ** kwargs ):
1085
+ def rename_axis (self , mapper = lib . no_default , ** kwargs ):
1090
1086
"""
1091
1087
Set the name of the axis for the index or columns.
1092
1088
@@ -1211,7 +1207,7 @@ class name
1211
1207
monkey 2 2
1212
1208
"""
1213
1209
axes , kwargs = self ._construct_axes_from_arguments (
1214
- (), kwargs , sentinel = sentinel
1210
+ (), kwargs , sentinel = lib . no_default
1215
1211
)
1216
1212
copy = kwargs .pop ("copy" , True )
1217
1213
inplace = kwargs .pop ("inplace" , False )
@@ -1227,7 +1223,7 @@ class name
1227
1223
1228
1224
inplace = validate_bool_kwarg (inplace , "inplace" )
1229
1225
1230
- if mapper is not sentinel :
1226
+ if mapper is not lib . no_default :
1231
1227
# Use v0.23 behavior if a scalar or list
1232
1228
non_mapper = is_scalar (mapper ) or (
1233
1229
is_list_like (mapper ) and not is_dict_like (mapper )
@@ -1243,7 +1239,7 @@ class name
1243
1239
1244
1240
for axis in range (self ._AXIS_LEN ):
1245
1241
v = axes .get (self ._AXIS_NAMES [axis ])
1246
- if v is sentinel :
1242
+ if v is lib . no_default :
1247
1243
continue
1248
1244
non_mapper = is_scalar (v ) or (is_list_like (v ) and not is_dict_like (v ))
1249
1245
if non_mapper :
0 commit comments