Python's 8-bit cleanness deprecated?

Anders J. Munch andersjm at dancontrol.dk
Wed Feb 5 11:16:37 EST 2003


"Erik Max Francis" <max at alcyone.com> wrote:
>
> The -*- convention is simply tipping its hat to a commonly-used
> convention; it's already used, e.g., to indicate the indentation level
> if desired.
>
> Seems plusses all around; one might consider -*- in particular ugly, but
> it's just following a common convention, and sometimes conformance and
> recognizability is better than beauty.

Quite.  But achieving both is not that hard.  How about this:

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"

and 'sacrifice to the gods of prior art'-style:

encoding: "-*- coding: latin-1 -*-"

and

encoding: "-*- codíng: latin-1 -*-"

can be signalled as an error instead of silently ignored.

- Anders







More information about the Python-list mailing list