title: Elegant way to handle "impossible" code paths
body: <p>Occasionally I'll have a situation where I've written some code and, based on its logic, a certain path is impossible. For example:</p>
  
  <pre><code>activeGames = [10, 20, 30]
  limit = 4
  
  def getBestActiveGameStat():
      if not activeGames: return None
      return max(activeGames)
  
  def bah():
      if limit == 0: return "Limit is 0"
  
      if len(activeGames) &gt;= limit:
          somestat = getBestActiveGameStat()
          if somestat is None:
              print "The universe has exploded"
          #etc...
  </code></pre>
  
  <p>What would go in the universe exploding line?  If limit is 0, then the function returns. If <code>len(activeGames) &gt;= limit</code>, then there must be at least one active game, so <code>getBestActiveGameStat()</code> can't return None. So, should I even check for it?</p>
  
  <p>The same also happens with something like a while loop which always returns in the loop:</p>
  
  <pre><code>def hmph():
      while condition:
          if foo: return "yep"
          doStuffToMakeFooTrue()
  
      raise SingularityFlippedMyBitsError()
  </code></pre>
  
  <p>Since I "know" it's impossible, should anything even be there?</p>