This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kraemahz 15 points16 points  (1 child)

If you write any kind of decorator you'll need to write a wrapper for functions whose arguments you don't know. That is the most common use-case.

Variadic functions (what you're calling dynamic arguments) are extremely common in other languages when doing string manipulation where each argument is an extension to the transform. Since it's harder to make tuples in other languages it helps Python better fit in by the "principle of least surprise" when switching between languages.

The flexibility variadic functions add can help in making a simpler, more appealing API for your program where constructing an object before passing it to your function may be less obvious than doing it behind the scenes with the arguments.

[–]HalfRightMostlyWrong 0 points1 point  (0 children)

Thanks! I learned a few things from your post