Is there a good rule of thumb as to when you should prefer varargs function signatures in your API over passing an iterable to a function? ("varargs" being short for "variadic" or "variable-number-of-arguments"; i.e. *args
)
For example, os.path.join
has a vararg signature:
os.path.join(first_component, *rest) -> str
Whereas min
allows either:
min(iterable[, key=func]) -> val
min(a, b, c, ...[, key=func]) -> val
Whereas any
/all
only permit an iterable:
any(iterable) -> bool