Top "Argument-unpacking" questions

Use this tag for questions related with argument unpacking, a technique that allows Arrays and Traversable objects to be extracted/unpacked into argument lists/sequences.

What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

In the following method definitions, what does the * and ** do for param2? def foo(param1, *param2): def bar(param1, **param2):

python syntax parameter-passing variadic-functions argument-unpacking
Passing an Array/List into Python

I've been looking at passing arrays, or lists, as Python tends to call them, into a function. I read something …

python parameter-passing argument-unpacking
What does the star operator mean, in a function call?

What does the * operator mean in Python, such as in code like zip(*x) or f(**k)? How is it …

python syntax parameter-passing iterable-unpacking argument-unpacking
Go Unpacking Array As Arguments

So in Python and Ruby there is the splat operator (*) for unpacking an array as arguments. In Javascript there is …

go argument-unpacking
Why this unpacking of arguments does not work?

I get an error type object argument after ** must be a mapping, not tuple. I have this code: create_character = …

python python-2.7 argument-unpacking
Python 3: starred expression to unpack a list

Example use: def f(a, b, c, d): print(a, b, c, d, sep = '&') f(1,2,3,4) >>&…

python python-3.x argument-unpacking
Unpacking, extended unpacking and nested extended unpacking

Consider the following expressions. Note that some expressions are repeated to present the "context". (this is a long list) a, …

python python-3.x iterable-unpacking argument-unpacking
How to extract parameters from a list and pass them to a function call

What is a good, brief way to extract items from a list and pass them as parameters to a function …

python list argument-unpacking
Unpack NumPy array by column

If I have a NumPy array, for example 5x3, is there a way to unpack it column by column all …

python arrays numpy argument-unpacking
Cannot unpack array with string keys

FATAL ERROR Uncaught Error: Cannot unpack array with string keys I know I can simply run the method fetch() twice …

php arrays argument-unpacking