title: Subclassing file in python 3
body: <p>In python 2, file was a proper class, so I wrote</p>
  
  <pre><code>class MyFile(file):  
    def floats_from_csv(self):  
      strs = self.read(1000000).split(',')  
      for i in strs:  
        yield float(i)
  
  with MyFile("x.csv", "rt") as x:
    for i in x.floats_from_csv():
      ...
  </code></pre>
  
  <p>In python3 the numerous file replacements have no public constructors, so I can't subclass and get a <code>__init__</code> function. I have a hack using delegation, but it's ugly. What is the approved way to create subclasses of the builtin IO classes?</p>