Translating Jargon

Martin Geisler mg at daimi.au.dk
Sun Feb 8 11:42:07 CST 2009


Tristan Wibberley <tristan at wibberley.org> writes:

> On Sun, 2009-02-08 at 14:54 +0100, Martin Geisler wrote:
>> Isaac Jurado <diptongo at gmail.com> writes:
>
>> Hehe :-) I also don't like having to tell people not to document their
>> functions in the usual Python way.
>> 
>> But changing all the docstrings into comments brings the number of
>> messages down from 1776 to 1651, a saving of 125 messages.
>
> What about annotating external apis with a decorator? Can that be used
> to extract the smaller set of docstrings?

Mercurial is Python 2.3 compatible but decorators were first part of
Python 2.4, so they're out.

Using comments instead of strings for the documentation looks like the
easiest solution.

Another solution would be to write a tool that dumps all the docstrings
we care about, something like this:

  for ext in extensions:
    mod = __import__(ext)
    dump(mod.__doc__)
    for cmd in mod.cmdtable:
      func = mod.cmdtable[cmd][0]
      dump(func.__doc__)

This should then be hooked into the build process.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20090208/f49b812e/attachment.pgp 


More information about the Mercurial-devel mailing list