Does this code read the first 10000 lines from a file? : <pre><code>def read_text(bz2_loc, n=10000):
    with BZ2File(bz2_loc) as file_:
        for i, line in enumerate(file_):
            data = json.loads(line)
            yield data["body"]
            if i &gt;= n:
                break
</code></pre>

<p>I think it reads each line and return the result immediately, and when it reaches 10000 lines, it jumps out of the loop. This piece of code doesn't complete the reading of the whole file. Is that true?</p>

<p>If I want to read the whole file, and yield once for each 10000, how to modify it? </p>
