title: Timeout issues with Python itertools.combinations()
body: <p>We've got a script that uses <code>itertools.combinations()</code> and it seems to hang with a large input size.</p>
  
  <p>I'm a relatively inexperienced Python programmer so I'm not sure how to fix this problem. Is there a more suitable library? Or is there a way to enable verbose logging to that I can debug why the method call is hanging?</p>
  
  <p>Any help is much appreciated.</p>
  
  <p>[Edit]</p>
  
  <pre><code>def findsubsets(S,m):
      return set( itertools.combinations(S, m) )
  
  for s in AllSearchTerms:
      S.append(itemsize)
      itemsize = itemsize + 1
  
  for i in range (1,6):
      Subset = findsubsets(S,i)
      for sub in Subset:
          for s in sub:
              sublist.append(AllSearchTerms[s])
          PComb.append(sublist)
          sublist = []
  </code></pre>