Variable name "args" can be confused with "*args"
Closed this issue · 3 comments
Several functions in CBI take a parameter called args
, intended to mean the "arguments" list that appears in a compilation database entry.
This can easily be confused with *args
, and should be changed to something like argv: list[str]
across all impacted functions.
I think the association is that args
is usually used like (*args, **kwargs
) and unpacked, so I mentally assume multiple things will be passed into the function like so:
def func(*args):
for arg in args: ...
where I can use the function like func(a, b, c, d)
, whereas this current style I can only use it via func((a, b, c, d))
.
Originally posted by @laserkelvin in #27 (comment)
Hey @Pennycook, if you could assign me, I'll open a PR for review.
Thanks, @itsjayway! Please note that both @laserkelvin and I will be out of the office after today, so apologies in advance if it takes us a few weeks to get around to reviewing your PR.