[Python-ideas] duck typing for io write methods

Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de
Sun Jun 16 07:42:09 CEST 2013


Victor Stinner <victor.stinner at ...> writes:
> 
> I don't think that converting bytes to str is the bottleneck when you
> read a long text file... (Reading data from disk is known to be
> *slow*.)
> 
>From the io module docs (Python 3.3):
"Text I/O over a binary storage (such as a file) is significantly slower
than binary I/O over the same storage, because it requires conversions
between unicode and binary data using a character codec. This can become
noticeable handling huge amounts of text data like large log files."
Wolfgang





More information about the Python-ideas mailing list