Comment on PEP 263 - Defining Python Source Code Encodings

Robin Becker robin at jessikat.fsnet.co.uk
Sat May 11 05:53:22 EDT 2002


In article <mailman.1021103664.20500.python-list at python.org>, Martin v.
Löwis <loewis at informatik.hu-berlin.de> writes
.....
>> 
>>              #!/usr/bin/python
>>              # -*- coding: <encoding name> -*-
>> 
>> 
>> why not use something like:
>> 
>>              #!/usr/bin/python
>>              #<python version="2.2.1" encoding="utf-8" />
>
>What is the advantage of this notation? The advantage of the above
>notation is that existing editors already recognize it. Compared to
>your proposal, it has also the advantage that it is easier to type.
>
...... Which editors use this? I suppose emacs/xemac or similar, but
since emacs is a minority editor (even amongst unixers) I think that 
the recognition pattern issue is open. A vi(m) compatible thing reaches
a larger audience, but then I use that :)

No doubt pythonwin will follow whatever is decided, but what about mac
users and all the people using notepad, ed, bliss etc etc?

It would be nice to know which editors (today) are unicode aware and how
they do the encoding recognition thing. If we then also had usage
figures, perhaps there could be a reasonable numbers game.

As for the PEP itself the only snag seems to me to be the BOM + comment
problem. If I change the BOM by hitting saveAs myWeirdEncoding the file
is a dead python unless I also change the comment (or is that an issue
only with utf8 at present?).

I agree  version specifications is a separate issue.
>Precisely my question.
>
>Regards,
>Martin
>
>

-- 
Robin Becker



More information about the Python-list mailing list