What is the correct name for operator *
, as in function(*args)
? unpack, unzip, something else?
views:
752answers:
5
+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
2010-02-23 22:53:19
Is there a name for `**` too, or is it unique to Python?
THC4k
2010-02-23 22:58:21
never once heard/seen "splat" in about 10 years of using python.
Joe Koberg
2010-02-23 23:00:55
Well in python it's also used to **pack** argument lists, so in that context should it be called **unsplat**? :)
gnibbler
2010-02-23 23:17:27
@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
2010-02-25 17:39:25
@THC4k I propose `splatsplat`.
jleedev
2010-04-07 00:57:37
+1
A:
I believe it's most commonly called the "splat operator." Unpacking arguments is what is does.
Chuck
2010-02-23 22:55:23
+3
A:
The Python Tutorial is simply calls it 'the *
-operator'. It performs unpacking of arbitrary argument lists.
Danilo Piazzalunga
2010-02-23 22:57:18
+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
2010-02-23 23:10:06
I also just say `kwargs`, although that doesn't really refer to the operator itself I suppose.
TM
2010-02-23 23:32:31
+3
A:
I call it "positional expansion", as opposed to **
which I call "keyword expansion".
Ignacio Vazquez-Abrams
2010-02-24 02:40:50