[Python-Dev] Allowing u.encode() to return non-strings

Bill Janssen janssen at parc.com
Wed Jun 30 23:21:28 EDT 2004


Tim,

Thanks for pointing this out.  I find it very hard to know that from
any of the documentation, unless of course you already know it, in
which case you don't need the documentation :-).  In particular, I'd
suggest adding some text to the documentation on codecs.open() which
points out that read and readlines and friends will in fact return
Unicode objects.

I assume, though, that the args to "read()" and friends are still
about bytes.

>> Any file that is not explicitly opened as binary (with the 'b' flag
>> (and, by the way, why isn't the 'b' flag the default for file opening?

> Because it isn't in C.

That's probably why Python doesn't have list comprehensions, either :-).

Bill





More information about the Python-Dev mailing list