Skip to content

Commit 3d4f9dc

Browse files
authored
fstring updates. Changing from .format to fstring (#33557)
1 parent f731f6d commit 3d4f9dc

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pandas/util/_decorators.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,13 @@ def _format_argument_list(allow_args: Union[List[str], int]):
237237
elif allow_args == 1:
238238
return " except for the first argument"
239239
elif isinstance(allow_args, int):
240-
return " except for the first {num_args} arguments".format(num_args=allow_args)
240+
return f" except for the first {allow_args} arguments"
241241
elif len(allow_args) == 1:
242-
return " except for the argument '{arg}'".format(arg=allow_args[0])
242+
return f" except for the argument '{allow_args[0]}'"
243243
else:
244244
last = allow_args[-1]
245245
args = ", ".join(["'" + x + "'" for x in allow_args[:-1]])
246-
return " except for the arguments {args} and '{last}'".format(
247-
args=args, last=last
248-
)
246+
return f" except for the arguments {args} and '{last}'"
249247

250248

251249
def deprecate_nonkeyword_arguments(

0 commit comments

Comments
 (0)