Python's 8-bit cleanness deprecated?

Chris Liechti cliechti at gmx.net
Sat Feb 8 16:00:47 EST 2003


"M.-A. Lemburg" <mal at lemburg.com> wrote in
news:mailman.1044713617.23449.python-list at python.org:
> The encoding matters because the complete file is passed to
> the codec. Thus, comments in different encodings are likely going
> to cause decoding errors.

And that's exactly the bad thing of the PEP. This means that comments are 
syntax checked and cause errors (in the future) IMHO for no good reason.

getting a warning/error for such characters in string litterals are an 
inconvenience but probalbly needed if we wan't to have a clean solution in 
the future.

(strip comments before feeding it to the codec. dropping the rest of a line 
with '#' shouldn't be that hard to do, is it?)

> While I agree that this will cause some work, I don't think
> that adding the encoding header to source files is all that
> hard to do. Making things explicit will save you much more time
> in the future than you have to spend now to fix the situation.

it's not hard to do for current or future projects, but some older and 
unmaintained but perfectly working modules will print a warning because of 
comments. i think specifying the encoding in a comment is ugly but we can 
live with it. it's that warning for a comment part that i dont like.
 
chris

-- 
Chris <cliechti at gmx.net>





More information about the Python-list mailing list