title: Using an arbitrary maximum in range()
body: <p>Is there a way in Python to iterate over every integer until something happens? Right now I tend to do one of the following:</p>
  
  <pre><code>for i in range(999999999):
     ...
     if something:
         break
  </code></pre>
  
  <p>or</p>
  
  <pre><code>i = 0
  status = True
  while status:
      ...
      if something:
          status = False
      i += 1
  </code></pre>
  
  <p>Both of these methods work for what I'm doing, but I'm sure there's a better way to do it. Please point me in the right direction.</p>