[Python-Dev] Re: PEP: Defining Unicode Literal Encodings

Paul Prescod paulp@ActiveState.com
Fri, 13 Jul 2001 12:38:49 -0700

Guido van Rossum wrote:
> Hm, then the directive would syntactically have to *precede* the
> docstring.  

It makes sense for the directive to precede the docstring because the
directive should be able to change the definition of the docstring!

> That currently doesn't work -- the docstring may only be
> preceded by blank lines and comments.  Lots of tools for processing
> docstrings already have this built into them.

The directive statement is inherently a backwards incompatible
extension. It is a grammar change. Many tools sniff out the docstring
from the loaded module anyhow.

>   Is it worth breaking
> them so that editors can remain stupid?

I would say that the more important consideration is that it just makes
sense to figure out what encoding you are using before you start
processing strings!

Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook