title: Parentheses pairing ({}[]()<>) issue
body: <p>I want to be able to pair up all parentheses in a string, if they aren't paired then then they get their index number and False. It seems like it is repeating some values over and over, i.e cl == pop[1]. I have tried to see where the problem is but I can't see it no matter how hard I try. So I'm asking if anyone help me to locate the error and maybe even improve my code ;)</p>
  
  <pre><code>def check_parentheses(string):
      pending = 0
      brackets = []
      '''Checks if parens are paired, otherwise they are bad.'''
      parenstack = collections.deque()
      for ch in string:
          if ch in lrmap:
              try:
                  cl = string.index(ch, pending)
                  pending = cl + 1
  
              except:
                  cl = False
  
          if ch in lparens:
              parenstack.append([ch, cl])
              print parenstack
  
          elif ch in rparens:
              try:
                  pop = parenstack.pop()
  
                  if lrmap[pop[0]] != ch:
                      print 'wrong type of parenthesis popped from stack',\
                      pop[0], ch, pop[1], cl
  
                      brackets.append([pop[1], False])
                      brackets.append([cl, False])
                  else:
                      brackets.append([pop[1], cl])
  
              except IndexError:
                  print 'no opening parenthesis left in stack'
                  brackets.append([cl, False])
  
      # if we are not out of opening parentheses, we have a mismatch
      for p in parenstack:
          brackets.append([p[1],False])
      return brackets
  </code></pre>