python 3, subclassing TextIOWrapper.

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon Mar 23 00:21:17 CET 2009


En Sun, 22 Mar 2009 19:12:13 -0300, Benjamin Peterson  
<benjamin at python.org> escribió:
> Gabriel Genellina <gagsl-py2 <at> yahoo.com.ar> writes:
>>
>> The undocumented behavior is relying on the open() builtin to return a
>> BufferedReader for a binary file.
>
> I don't see the problem. open() will return some BufferedIOBase  
> implmentor, and
> that's all that TextIOWrapper needs.

How do you know? AFAIK, the return value of open() is completely  
undocumented:
http://docs.python.org/3.0/library/functions.html#open
And if you open the  file in text mode, the return value isn't a  
BufferedIOBase.

-- 
Gabriel Genellina




More information about the Python-list mailing list