So there is *args
in python where you can give arbitrary number of arguments to a function. Lets say I've created the following code
def example_sum(*args):
return sum(args)
And when i'm trying to use it in my editor(VS code), it hints the function parameter like the following
(*args)
Now for more easier to understand my code, I want to name the *args
to something else. And I just found out that you can indeed rename it.
def example_sum(*numbers_to_sum):
return sum(numbers_to_sum)
But the thing is I don't think I've seen other programmers rename this. So was wondering if it was a good practice?
*args
is an acceptable name. I think it's these examples you've seen.