title: Why does Python allow unpacking an empty iterable?
body: <p>I was writing some code and made a typo, but it didn't error. Tracing it back, I found out that these work:</p>
  <pre><code>&gt;&gt;&gt; [] = []
  &gt;&gt;&gt; () = ()
  &gt;&gt;&gt; 
  </code></pre>
  <p>This is iterable unpacking, but with no real target for assignment. Why does Python allow this? Are there situations where this is useful?</p>
  <p><a href="https://docs.python.org/3/reference/simple_stmts.html#grammar-token-target" rel="nofollow noreferrer">Here's where it's defined in the grammar</a>. I would have thought you'd need at least one <em>identifier</em>, <em>attributeref</em>, <em>subscription</em>, or <em>slicing</em>, but apparently not; <em>target_list</em> is optional inside parentheses or brackets.</p>
  <pre><code>target ::=  identifier
              | &quot;(&quot; [target_list] &quot;)&quot;
              | &quot;[&quot; [target_list] &quot;]&quot;
              | attributeref
              | subscription
              | slicing
              | &quot;*&quot; target
  </code></pre>
  <p>Looking at the documentation history, this wasn't possible as recently as <a href="https://docs.python.org/3.4/reference/simple_stmts.html#assignment-statements" rel="nofollow noreferrer">Python 3.4</a> and <a href="https://docs.python.org/2.6/reference/simple_stmts.html#assignment-statements" rel="nofollow noreferrer">2.6</a>, but assigning to <code>[]</code> was added in <a href="https://docs.python.org/3.5/reference/simple_stmts.html#assignment-statements" rel="nofollow noreferrer">Python 3.5</a> and <a href="https://docs.python.org/2.7/reference/simple_stmts.html#assignment-statements" rel="nofollow noreferrer">2.7</a>, and <code>()</code> in <a href="https://docs.python.org/3.6/reference/simple_stmts.html#assignment-statements" rel="nofollow noreferrer">Python 3.6</a>.</p>
  <p>Related:</p>
  <ul>
  <li><a href="https://stackoverflow.com/q/29870019/4518341">Why is it valid to assign to an empty list but not to an empty tuple?</a> (The answer was ultimately a bug)</li>
  <li><a href="https://stackoverflow.com/q/30147165/4518341">Why isn&#39;t assigning to an empty list (e.g. [] = &quot;&quot;) an error?</a> (Answers talk more about <em>how</em> than <em>why</em>)</li>
  </ul>
  <p><em>Note: Since I'm asking about a design choice, answers should include references to authoritative sources like official documentation or a core dev.</em></p>