[Python-Dev] Python3 "complexity"

Chris Angelico rosuav at gmail.com
Thu Jan 9 09:03:53 CET 2014


On Thu, Jan 9, 2014 at 5:50 PM, Lennart Regebro <regebro at gmail.com> wrote:
> To be honest, you can define text as "A stream of bytes that are split
> up in lines separated by a linefeed", and do some basic text
> processing like that. Just very *basic*, but still. Replacing
> characters. Extracting certain lines etc.

You would have to define it as "A stream of bytes encoded in
{ASCII|Latin-1|CP-1252|UTF-8} that" etc etc. Otherwise, those bytes
might be EBCDIC, UTF-16, or anything else, and your code will fail.
And once you've demanded that, well, you're right back here with
clarifying encodings, so you may as well just pass encoding="ascii"
and do it honestly.

ChrisA


More information about the Python-Dev mailing list