Python's 8-bit cleanness deprecated?

Brian Quinlan brian at sweetapp.com
Wed Feb 5 13:59:50 EST 2003


> I think it's more in the Python tradition (although this particular
> tradition is one that I don't like) to use a variable:
> 
> __encoding__ = "latin-1"

It has to be a bit more special than that because the encoding must be
detected before the grammar is parsed. Variable assignment would be
acceptable, I guess, except that the assignment:

1. would have to use a simplified grammar
2. it would have to be near the top of the file

The encoding is really meta information that shouldn't be in source
files. It definitely should not be part of the language. But we live in
the real world were there is no where else to put it. 

Cheers,
Brian 






More information about the Python-list mailing list