Martin v. Löwis <mar...@v.loewis.de> added the comment:

> class file(io.TextIOWrapper):
> 
>     '''condensing code for this list without test is a no no!'''
> 
>     def __init__(self,name):
>         self.stream = open(name)   # SAVE THE STREAM!
>         super().__init__(self.stream.buffer)

I don't know what this is supposed to achieve, but it looks incorrect.
I would write it as

py> class file(io.TextIOWrapper):
...   def __init__(self, name):
...     super().__init__(io.BufferedReader(io.FileIO(name, "r")))
...

Your version creates a separate TextIOWrapper for no apparent reason.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5513>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to