[Python-Dev] Adding examples to PEP 263

M.-A. Lemburg mal at egenix.com
Fri Nov 4 10:27:43 CET 2005

Fredrik Lundh wrote:
> the runtime warning you get when you use non-ascii characters in
> python source code points the poor user to this page:
>     http://www.python.org/peps/pep-0263.html
> which tells the user to add a
>     # -*- coding: <encoding name> -*-
> to the source, and then provides a more detailed syntax description
> as a RE pattern.  to help people that didn't grow up with emacs, and
> don't speak fluent RE, and/or prefer to skim documentation, it would
> be a quite helpful if the page also contained a few examples; e.g.
> # -*- coding: utf-8 -*-
> # -*- coding: iso-8859-1 -*-
> can anyone with SVN write access perhaps add this?

Good point. I'll add some examples.

> (I'd probably add a note to the top of the page for anyone who arrives
> there via a Python error message, which summarizes the pep and provides
> an example or two; abstracts and rationales are nice, but if you're just a
> plain user, a "do this; here's how it works; further discussion below" style
> is a bit more practical...)

The PEP isn't all that long, so I don't think a summary would
help. However, we might want to point the user to a different
URL in the error message, e.g. a Wiki page with more user-friendly

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Nov 04 2005)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
2005-10-17: Released mxODBC.Zope.DA 1.0.9        http://zope.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the Python-Dev mailing list