title: Get combinations in C rather than in Python itertools.combinations
body: <p><strong>Is switching to C an adequate approach to get the combinations faster than in Python or am I on a wrong track?</strong> I only &quot;speak&quot; python and hope for some <strong>guidance to decide on the next programming steps</strong> for my self-chosen learning project. I am working on a Data Science project and based on your answers, I would recommend to invite a computer scientist to the project or drop my project approach.</p>
  <p>I have a list of 69 strings where I need all possible combinations of 8 elements.
  At the moment I can do this in python with itertools.combinations()</p>
  <pre><code>for i in itertools.combinations(DictAthleteObjects.keys()),8):
     do stuff here on instances of classes
  </code></pre>
  <p>In Python the itertools.combinations works perfectly fine for a view combinations but due to the large amount of combinations it is not time efficient and sometimes crashes (I think because of too less memory) when not breaking the loop after a view iterations. Generally the time-complexity is very large.</p>
  <p>According to <a href="https://stackoverflow.com/questions/52570192/why-does-a-large-for-loop-with-10-billion-iterations-take-a-much-longer-time-to">this StackOverflow discussion</a> it could be a valid approach to generate the combinations in C <em>and also do all the programming that works in python in C</em>, because its much faster.</p>
  <p>On the other hand I have received a comment that itertools.combinations is using C itself. But I cannot find any sources on that.</p>