3 ms·
Python has keyword arguments to functions. In that context, a single star packs or unpacks a list of positional arguments and a double star packs or unpacks a
by gdwatson 4y ago
Python has keyword arguments to functions. In that context, a single star packs or unpacks a list of positional arguments and a double star packs or unpacks a dictionary of keyword arguments.
- gpderetta 4y agoTo complete the description, dictionaries are iterable by key only by default[1], so *dict would be ambiguous if it could splat both. [1] a misfeature, IMNSHO.