title: Is there anyway of unpacking a Python list and convert to int at the same time?
body: <p>I have this snippet:</p>
  <pre class="lang-py prettyprint-override"><code>s = &quot;A 1 B 2&quot;
  a, a1, b, b1 = s.split()
  a1 = int(a1)
  b1 = int(b1)
  </code></pre>
  <p>I was wondering if there is anyway of unpacking and converting to <code>int</code> or anything else at the same time. I can also write the snippet as follows:</p>
  <pre><code>s = &quot;A 1 B 2&quot;
  a, a1, b, b1 = (int(x) if i in (1, 3) else i, x for x in enumerate(s.split()))
  </code></pre>
  <p>But I wanted to know if there is a shorter version. Something like</p>
  <pre class="lang-py prettyprint-override"><code>a, int(a1), b, int(b1) = s.split()
  </code></pre>
  <p>which would make something like this also possible:</p>
  <pre class="lang-py prettyprint-override"><code>s = &quot;A 1 B 2.3&quot;
  a, int(a1), b, float(b1) = s.split()
  </code></pre>