title: How to perform assignment destructuring using the walrus operator in Python
body: <p>I can do an assignment destructuring as:</p>
  
  <pre><code>a, b = s.split(' ', 1)
  </code></pre>
  
  <p>for a string <code>s</code> which has more than one word.</p>
  
  <p>How can we do the same in, say an <strong><code>if</code></strong> or <strong><code>elif</code></strong>, with the latest assignment expression introduced in Python 3.8 (is it possible to have multiple targets) ?</p>
  
  <p>I tried:</p>
  
  <pre><code>if some_thing:
      # some code.
  elif (<b>a, b := s.split(' ', 1)</b>) and some_func(a) and some_func(b):
      # some code probably using a and b as well.</code></pre>
  
  <p>I get following error:</p>
  
  <pre><code>elif (a, b := s.split(' ', 1)) and some_func(a) and some_func(b):
  NameError: name 'a' is not defined
  </code></pre>
  
  <p>The reason I want this is because I don't want to split my string unnecessarily if my first condition is satisfied.</p>