Therefore, apparently, I cannot do this in Python (2.7):
x = (1, 2,) (a, b, c) = (*x, 3)
It made sense in my head, but well ... I could create a function:
make_tuple = lambda *elements: tuple(elements)
then i can do
(c, a, b) = make_tuple(3, *x)
but not for example
(a, b, c) = make_tuple(*x, 3) (a, b, c, d) = make_tuple(*x, *x) y = [3, 4] (a, b, c, d) = (*x, *y,)
So I ask
- Is there any reason not to allow this? (first)
- what's the closest thing that works?
My current guess for # 2:
(a, b, c) = x + (3,) (a, b, c, d) = x + x (a, b, c, d) = x + tuple(y)