Message83824
> 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. |
|
Date |
User |
Action |
Args |
2009-03-19 22:51:10 | loewis | set | recipients:
+ loewis, georg.brandl, rhettinger, LambertDW, MLModel |
2009-03-19 22:48:00 | loewis | link | issue5513 messages |
2009-03-19 22:48:00 | loewis | create | |
|