title: How to add an extra middle step into a list comprehension?
body: <p>Let's say I have a <code>list[str]</code> object containing timestamps in <code>&quot;HH:mm&quot;</code> format, e.g.</p>
  <pre><code>timestamps = [&quot;22:58&quot;, &quot;03:11&quot;, &quot;12:21&quot;]
  </code></pre>
  <p>I want to convert it to a <code>list[int]</code> object with the &quot;number of minutes since midnight&quot; values for each timestamp:</p>
  <pre><code>converted = [22*60+58, 3*60+11, 12*60+21]
  </code></pre>
  <p>... but I want to do it in style and use a single list comprehension to do it. A (syntactically incorrect) implementation that I naively constructed was something like:</p>
  <pre><code>def timestamps_to_minutes(timestamps: list[str]) -&gt; list[int]:
      return [int(hh) * 60 + int(mm) for ts in timestamps for hh, mm = ts.split(&quot;:&quot;)]
  </code></pre>
  <p>... but this doesn't work because <code>for hh, mm = ts.split(&quot;:&quot;)</code> is not a valid syntax.</p>
  <p>What would be the valid way of writing the same thing?</p>
  <p>To clarify: I can see a formally satisfying solution in the form of:</p>
  <pre><code>def timestamps_to_minutes(timestamps: list[str]) -&gt; list[int]:
      return [int(ts.split(&quot;:&quot;)[0]) * 60 + int(ts.split(&quot;:&quot;)[1]) for ts in timestamps]
  </code></pre>
  <p>... but this is highly inefficient and I don't want to split the string twice.</p>