Top "Iterable-unpacking" questions

A Python feature in which elements of an iterable are simultaneously assigned to multiple variables, e.g. a, b, c = [1, 2, 3].

Python star unpacking for version 2.7

As mentioned here, you can use the star for unpacking an unknown number of variables (like in functions), but only …

python iterable-unpacking
TypeError: <lambda>() missing 1 required positional argument: 'w'

Code is here return self.activator(reduce(lambda a, b: a+b, map(lambda x, w: x*w, zip(input_…

python python-3.x lambda tuples iterable-unpacking
Swapping Columns with NumPy arrays

When I have a=1 and b=2, I can write a,b=b,a so that a and b are interchanged …

python arrays numpy iterable-unpacking
Scala: Unpacking tuple as part of argument list

I am trying to send the result of a method call's tuple, as part of the argument list for another …

scala tuples iterable-unpacking arity
Is it possible to unpack a tuple in Python without creating unwanted variables?

Is there a way to write the following function so that my IDE doesn't complain that column is an unused …

python tuples iterable-unpacking
How does swapping of members in tuples (a,b)=(b,a) work internally?

In [55]: a = 5 In [56]: b = 6 In [57]: (a, b) = (b, a) In [58]: a Out[58]: 6 In [59]: b Out[59]: 5 How does this swapping of …

python tuples python-internals iterable-unpacking
Is 'shift' evil for processing Perl subroutine parameters?

I'm frequently using shift to unpack function parameters: sub my_sub { my $self = shift; my $params = shift; .... } However, many on …

perl parameters shift iterable-unpacking
Tuples and unpacking assignment support in C#?

In Python I can write def myMethod(): #some work to find the row and col return (row, col) row, col = …

c# tuples iterable-unpacking decomposition
Unpacking argument lists for ellipsis in R

I am confused by the use of the ellipsis (...) in some functions, i.e. how to pass an object containing …

list r ellipsis iterable-unpacking
Python swapping lists

In python, when I assign a list to another, like: a = [1,2,3] b = a Now b and a point to the …

python list iterable-unpacking python-internals