title: What can I do with a closed file object?
body: <p>When you open a file, it's stored in an open file object which gives you access to various methods on it such as reading or writing.</p>
  
  <pre><code>&gt;&gt;&gt; f = open("file0")
  &gt;&gt;&gt; f
  &lt;open file 'file0', mode 'r' at 0x0000000002E51660&gt;
  </code></pre>
  
  <p>Of course when you're done you should close your file to prevent it taking up memory space.</p>
  
  <pre><code>&gt;&gt;&gt; f.close()
  &gt;&gt;&gt; f
  &lt;closed file 'file0', mode 'r' at 0x0000000002E51660&gt;
  </code></pre>
  
  <p>This leaves a closed file, so that the object still exists though it's no longer using space for the sake of being readable. But is there any practical application of this? It can't be read, or written. It can't be used to reopen the file again.</p>
  
  <pre><code>&gt;&gt;&gt; f.open()
  
  Traceback (most recent call last):
    File "&lt;pyshell#9&gt;", line 1, in &lt;module&gt;
      f.open()
  AttributeError: 'file' object has no attribute 'open'
  
  &gt;&gt;&gt; open(f)
  
  Traceback (most recent call last):
    File "&lt;pyshell#10&gt;", line 1, in &lt;module&gt;
      open(f)
  TypeError: coercing to Unicode: need string or buffer, file found
  </code></pre>
  
  <p>Is there a practical use for this closed file object aside from identifying that a file object is being referenced but is closed?</p>