Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #22185

Re: verbs in comments [OT]

Date 2012-03-26 14:36 +0200
From Jean-Michel Pichavant <jeanmichel@sequans.com>
Subject Re: verbs in comments [OT]
References <4f6e2265$0$1382$4fafbaef@reader2.news.tin.it>
Newsgroups comp.lang.python
Message-ID <mailman.998.1332765381.3037.python-list@python.org> (permalink)

Show all headers | View raw


Kiuhnm wrote:
> Why do you write
>   // Print the number of words...
>   def printNumWords(): ...
> and not
>   // Prints the number of words...
>   def printNumWords(): ...
> where "it" is understood?
> Is that an imperative or a base form or something else?
>
> Kiuhnm

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

"The docstring is a phrase ending in a period. It prescribes the 
function or method's effect as a command ("Do this", "Return that"), not 
as a description; e.g. don't write "Returns the pathname ..."

I apply the same rule to comments, I now don't loose time asking myself 
how to write these docs/comments.

JM

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

verbs in comments [OT] Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-24 20:36 +0100
  Re: verbs in comments [OT] MRAB <python@mrabarnett.plus.com> - 2012-03-24 20:24 +0000
    Re: verbs in comments [OT] Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-24 22:15 +0100
  Re: verbs in comments [OT] Chris Angelico <rosuav@gmail.com> - 2012-03-25 09:36 +1100
    Re: verbs in comments [OT] Roy Smith <roy@panix.com> - 2012-03-24 19:27 -0400
  Re: verbs in comments [OT] Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-03-26 14:36 +0200

csiph-web