A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-July/045829.html below:

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

[Python-Dev] Allowing u.encode() to return non-strings [Python-Dev] Allowing u.encode() to return non-strings"Martin v. Löwis" martin at v.loewis.de
Thu Jul 1 23:45:52 CEST 2004
Bill Janssen wrote:
> I assume, though, that the args to "read()" and friends are still
> about bytes.

Yes. It is not possible to determine, in advance, the number of
bytes needed to decode a given number of characters. Therefore, a
codec typically needs to either read more bytes than requested,
or return less characters (if the bytes read don't happen to
end on a character boundary).

So the size parameter to .read() is just a hint - a codec might
chose to completely ignore it.

Regards,
Martin


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4