[I18n-sig] pygettext and PEP #?#

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri, 14 Sep 2001 22:49:08 +0200


> Probably Python's module-level doc-string could also adopt
> RFC-822 style header which will provide such meta-information?
> (Right now doc strings do not concatenate).
> 
> That is, making __doc__ RFC822 message which header has metainfromation
> and body - usual comments.

It depends on what you want to use this information for. If you want
the interpreter to automatically react in some way (e.g. convert
strings to Unicode objects automatically based on the module
encoding), then I suggest that (ab-)using the doc string for that is a
bad idea.

Furthermore, I doubt that many users of doc strings are interested in
the encoding of the module doc string (which they'd get when doing
help(module)); instead, they only care that it prints right even if it
is not ASCII.

There are many ways to signal languages, and RFC822 headers are surely
one of them (the application in GNU message catalogs originated from
MIME, which is also the foundation for indicating languages in HTTP).

So the problem is not so much the format of the meta information, but
where to place it and how to process it.

Regards,
Martin