[Python-Dev] "declare" reserved word (was: pragma)

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Sat, 2 Sep 2000 13:32:31 +0200


mal wrote:
> I gave some examples in the other pragma thread. The main
> idea behind "declare" is to define flags at compilation
> time, the encoding of string literals being one of the
> original motivations for introducing these flags:
>
> declare encoding = "latin-1"
> x = u"This text will be interpreted as Latin-1 and stored as Unicode"
>
> declare encoding = "ascii"
> y = u"This is supposed to be ASCII, but contains äöü Umlauts - error !"

-1

for sanity's sake, we should only allow a *single* encoding per
source file.  anything else is madness.

besides, the goal should be to apply the encoding to the entire
file, not just the contents of string literals.

(hint: how many editing and display environments support multiple
encodings per text file?)

</F>