Unpacking tuples in a python list comprehension (cannot use the *-operator)
<p>I am trying to create a list based on another list, with the same values repeated 3 times consecutively.</p>

<p>At the moment, I am using:</p>

<pre><code>&gt;&gt;&gt; my_list = [ 1, 2 ]
&gt;&gt;&gt; three_times = []
&gt;&gt;&gt; for i in range( len( my_list ) ):
...   for j in range( 3 ):
...     three_times.append( my_list[ i ] )
...
&gt;&gt;&gt; print three_times
[1, 1, 1, 2, 2, 2]
</code></pre>

<p>But I would like to do it using a more Pythonic way, such as:</p>

<pre><code>&gt;&gt;&gt; my_list = [ 1, 2 ]
&gt;&gt;&gt; three_times = []
&gt;&gt;&gt; three_times = [ (value,) * 3 for value in my_list ]
&gt;&gt;&gt; print three_times
[(1, 1, 1), (2, 2, 2)]
</code></pre>

<p>However, I cannot find a way to unpack the tuples.  </p>

<p>Something like <code>three_times = [ *( (value,) * 3 ) for value in my_list ]</code> would be perfect for unpacking the tuples but this is not a correct syntax.</p>