Is file closed or still in memory?
<pre><code>lines = len(open(filename, 'r').readlines()) //or
open(filename, 'w').writelines(lines)
</code></pre>

<p>Does this lines in python, closes the opened file? If not how to close files which are not assigned to any variable? Also what these type of coding is called, is it "refcounting semantics"?</p>
