title: How does itertools.combinations scale in Python?
body: <p>I'm doing a brute-force approach to trying to find the combination to an extension to a puzzle.</p>
  
  <p>I am trying to get a large number of combinations and then test each combination to see if they fit certain criteria. 
  I generate the combinations using Python's excellent itertools, essentially this gives me an iterator I can go over and test each one.</p>
  
  <p>This returns quickly and gives me <strong>91390</strong> combinations to check:</p>
  
  <pre><code>itertools.combinations(range(1, 40), 4)
  </code></pre>
  
  <p>This takes a couple of minutes and give me <strong>198792594</strong> combinations to test: </p>
  
  <pre><code>itertools.combinations(range(1, 122), 5)
  </code></pre>
  
  <p>When I get to the next level, I need the answer to this:</p>
  
  <pre><code>itertools.combinations(range(1, 365), 6)
  </code></pre>
  
  <p>When I get into 6-way combinations of a set of 364... it takes a very long time. <strong>AGES</strong>. Am I inherently asking for a great deal of combinations? How does it scale?</p>