[PATCH] More typos (was: Added missing space and reformatted docstring)

Martin Geisler mg at daimi.au.dk
Tue Aug 12 02:40:58 CDT 2008


Brendan Cully <brendan at kublai.com> writes:

> On Monday, 11 August 2008 at 22:38, Martin Geisler wrote:
>> Martin Geisler <mg at daimi.au.dk> writes:
>> 
>> > -        To reduce annotation cost,
>> > -        this returns fixed value(False is used) as linenumber,
>> > -        if "linenumber" parameter is "False".'''
>> > +        To reduce annotation cost, this returns fixed value (False is
>> > +        used) as linenumber, if "linenumber" parameter is "False".'''
>> 
>> What do people feel about documentation patches like this one and
>> would it be appreciated if I tried writing more docstrings?
>> 
>> I'm not talking about the mindless JavaDoc-like style where you
>> write repetitive stuff like "Returns the result.\n\n at return result:
>> the result.", but more some explanation for the central classes --
>> what are they good for and how do they play together.
>
> I think they're great, until they become out of sync with the code
> they describe :)

Right, that is always the problem... :-) Now that I have looked some
more at the code I must say that there are more comments than I
originally thought, so it's not bad at all.

But there seems to be a couple of different styles for the docstrings:
Many start with a small letter, only some end with periods, both
double- and single-quotes are used, etc. Would you guys accept patches
that tries to make this more uniform following PEP 257?

  http://www.python.org/dev/peps/pep-0257/

Anyway, here is another patch with some typos I found:

# HG changeset patch
# User Martin Geisler <mg at daimi.au.dk>
# Date 1218491941 -7200
# Node ID 0d3c4dcae9a64131c385e60a18ec975a3a9b357d
# Parent  14a6521128651fcb5eff9f513afa364dd5df345a
Fixed docstring typos

diff -r 14a652112865 -r 0d3c4dcae9a6 mercurial/revlog.py
--- a/mercurial/revlog.py	Mon Aug 11 22:24:49 2008 +0200
+++ b/mercurial/revlog.py	Mon Aug 11 23:59:01 2008 +0200
@@ -421,7 +421,7 @@
     A revlog consists of two parts, an index and the revision data.
 
     The index is a file with a fixed record size containing
-    information on each revision, includings its nodeid (hash), the
+    information on each revision, including its nodeid (hash), the
     nodeids of its parents, the position and offset of its data within
     the data file, and the revision it's based on. Finally, each entry
     contains a linkrev entry that can serve as a pointer to external
@@ -942,7 +942,7 @@
                               self.revision(self.node(rev2)))
 
     def revision(self, node):
-        """return an uncompressed revision of a given"""
+        """return an uncompressed revision of a given node"""
         if node == nullid:
             return ""
         if self._cache and self._cache[0] == node:
@@ -1285,7 +1285,7 @@
 
         So we truncate the revlog on the first of these revisions, and
         trust that the caller has saved the revisions that shouldn't be
-        removed and that it'll readd them after this truncation.
+        removed and that it'll read them after this truncation.
         """
         if len(self) == 0:
             return

-- 
Martin Geisler

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


More information about the Mercurial-devel mailing list