title: Is there any way to catch a "too many values to unpack" error?
body: <p>This usage of my subclass of tuple:</p>
  
  <pre><code>class MyTuple(tuple):
      def __new__(cls, columns=()):
          return tuple.__new__(cls, tuple(columns))
  
  a, b = MyTuple(columns=('hello', 'world', 42))
  </code></pre>
  
  <p>gives the following exception:</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 6, in &lt;module&gt;
  ValueError: too many values to unpack
  </code></pre>
  
  <p>A <code>ValueError</code> can have many causes, so do I need to use the following to catch it?</p>
  
  <pre><code>try:
      a, b = MyTuple(columns=('hello', 'world', 42))
  except ValueError as e:
      if not str(e).endswith('unpack'):
          raise  # false alarm
      # handle unpacking error here..
  </code></pre>
  
  <p>that seems rather inelegant.. Is there any way I can override which exception the tuple unpacking raises?</p>
  
  <p><strong>update:</strong> the actual use case is as follows</p>
  
  <pre><code>&gt;&gt;&gt; dice = FactSet()
  &gt;&gt;&gt; for i in range(1, 7):
  ...     dice.add('dice', n=i)
  ...
  &gt;&gt;&gt; print dice.n + dice.n == 10   # give me all combinations that add up to 10
  XPROD((dice(n=4), dice(n=6))
        (dice(n=5), dice(n=5))
        (dice(n=6), dice(n=4)))
  &gt;&gt;&gt; a, b = dice.n + dice.n == 10  # same as above, but unpack the individual die
  &gt;&gt;&gt; a
  FactSet([
      dice(n=4),
      dice(n=5),
      dice(n=6),
  ])
  &gt;&gt;&gt; b
  FactSet([
      dice(n=6),
      dice(n=5),
      dice(n=4),
  ])
  &gt;&gt;&gt; a, b = dice.n + dice.n == 13  # no result should probably raise a more specific exception?
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ValueError: need more than 0 values to unpack
  &gt;&gt;&gt; ab = dice.n + dice.n == 13  # this is much more awkward and forces you to deal with the error in-situ (which might not be what you wanted)
  &gt;&gt;&gt; if ab:
  &gt;&gt;&gt;     a, b = ab
  </code></pre>