3 ms·
I really like those names, 'splat operator' and 'splatty-splat operator.' > Inside Function Call > Splat expands a collection into positional arguments, while
by Rygian 3y ago
I really like those names, 'splat operator' and 'splatty-splat operator.'
> Inside Function Call
> Splat expands a collection into positional arguments, while splatty-splat expands a dictionary into keyword arguments.
args = (1, 2)
kwargs = {'x': 3, 'y': 4, 'z': 5}
func(*args, **kwargs)
- gpderetta 3y agoHN ate your stars and for a few seconds I was confused that I forgot how python works.