[Python-Dev] Sharing docstrings between the Python and C implementations of a module

Stephen J. Turnbull stephen at xemacs.org
Tue Apr 16 09:48:02 CEST 2013

Skip Montanaro writes:

 > > Would it make sense to think about adding this in the scope of
 > > the argument clinic work, or is it too unrelated? This seems like
 > > a commonly needed thing for large parts of the stdlib (where the
 > > C accelerator overrides Python code).
 > Or maybe separate doc strings from both code bases altogether and
 > insert them where appropriate as part of the build process?

Experience with gettext vs other kinds of message catalogs for
localization suggests that's a really painful approach to take.

It's not entirely clear to me that this whole effort isn't a premature
optimization.  Eventually (next 5 to 15 years? long run, anyway) we'll
probably localize, and *most* messages will be shared (from gettext
.mo files) anyway.  (Yes, I recognize that space is not the most
important aspect of sharing docstrings, and that it's likely shared
docstrings can be automatically shared by gettext.  We should take
care that that's so.)

The other thing that occurs to me is that maybe something like gettext
may be the way to deal with these issues anyway.

More information about the Python-Dev mailing list