Python·100 questions

How does unpacking *args and **kwargs work?

Answer
*args — positional arguments as a tuple.
**kwargs — named arguments as a dict.
You can proxy a call: f(*args, **kwargs).
Collection unpacking: [*a, *b].
Dict unpacking: {**d1, **d2}.
Was this answer helpful?

More questions in this topic

Related questions from other topics