Python's 8-bit cleanness deprecated?
phr-n2003b at NOSPAMnightsong.com
Wed Feb 5 19:39:55 CET 2003
"Anders J. Munch" <andersjm at dancontrol.dk> writes:
> A source encoding directive is a line containing three tokens: the
> identfier "encoding", a colon and a string constant. The string
> constant contains the name of the encoding, optionally surrounded by
> "-*- coding:" and "-*-". That way you have a choice between short and
> sweet style:
> encoding: "latin-1"
This isn't so great because if you insert an encoding statement, the
script will no longer run under older Pythons like 2.2.
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"
or if necessary:
__encoding__ = "-*- latin-1 -*-"
More information about the Python-list