Comment on PEP 263 - Defining Python Source Code Encodings

Martin v. Loewis martin at v.loewis.de
Mon May 13 02:32:44 EDT 2002


bokr at oz.net (Bengt Richter) writes:

> I think Robin is alluding to something like the problem of an
> encoding-conversion save-as export filter utility fed with a script
> with a given encoding and containing a magic comment. If the utility
> is not magic-comment-syntax-aware and able to change the comment to
> reflect the new encoding, there would be a problem to fix manually.

Indeed, that would be the case. Hopefully, few editors will silently
*change* the encoding.

> ISTM mixing meta-data and data in an ad-hoc way is not good, and
> encoding is meta-data w.r.t. the file it describes.

I disagree. Recent history has taught us "always know thy encoding";
IETF requires that every protocol to transfer text either specifies a
fixed encoding, or a mechanism to indicate the encoding dynamically.

The risk of data and metadata becoming detached is just too high if
they are not mixed. Also, I question that the encoding is meta-data:
this information affects the meaning of the Python program just as any
other program statement.

Regards,
Martin



More information about the Python-list mailing list