Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Python's `*` and `**` specifiers have a name? [duplicate]

What is the correct name for operator *, as in function(*args)? unpack, unzip, something else?

like image 808
Anycorn Avatar asked Feb 23 '10 22:02

Anycorn


2 Answers

In Ruby and Perl 6 this has been called "splat", and I think most people from those communities will figure out what you mean if you call it that.

The Python tutorial uses the phrase "unpacking argument lists", which is long and descriptive.

It is also referred to as iterable unpacking, or in the case of **, dictionary unpacking.

like image 57
ephemient Avatar answered Nov 13 '22 19:11

ephemient


I call it "positional expansion", as opposed to ** which I call "keyword expansion".

like image 126
Ignacio Vazquez-Abrams Avatar answered Nov 13 '22 21:11

Ignacio Vazquez-Abrams