views:

752

answers:

5

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

+7  A: 

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. I haven't heard any other particular name for it in Python.

ephemient
Is there a name for `**` too, or is it unique to Python?
THC4k
never once heard/seen "splat" in about 10 years of using python.
Joe Koberg
Well in python it's also used to **pack** argument lists, so in that context should it be called **unsplat**? :)
gnibbler
@gnibbler I think "splat" refers to the graphical appearance of `*`. But yeah, if you use it as a verb, then you splat the arguments in and unsplat them out :P
ephemient
@THC4k I propose `splatsplat`.
jleedev
+1  A: 

I believe it's most commonly called the "splat operator." Unpacking arguments is what is does.

Chuck
+3  A: 

The Python Tutorial is simply calls it 'the *-operator'. It performs unpacking of arbitrary argument lists.

Danilo Piazzalunga
+2  A: 

I say "star-args" and Python people seem to know what i mean.

** is trickier - I think just "qargs" since it is usually used as **kw or **kwargs

gnibbler
I also just say `kwargs`, although that doesn't really refer to the operator itself I suppose.
TM
+3  A: 

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

Ignacio Vazquez-Abrams