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


Groups > comp.lang.python > #22124

Re: verbs in comments [OT]

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.007
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'prints': 0.07; 'defined.': 0.09; 'from:addr:python': 0.09; 'def': 0.13; 'useful,': 0.13; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'reply- to:addr:python-list': 0.16; 'wrote:': 0.18; 'written': 0.19; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'right.': 0.25; 'function': 0.27; 'depends': 0.28; 'second': 0.28; 'example': 0.29; 'print': 0.29; 'does': 0.32; 'header:User-Agent:1': 0.33; 'received:84': 0.34; 'anything': 0.34; 'reply-to:addr:python.org': 0.34; 'probably': 0.35; 'to:addr:python-list': 0.35; '...': 0.35; 'something': 0.35; 'comment': 0.36; 'subject:]': 0.36; "i'd": 0.39; '(with': 0.39; 'called': 0.40; 'to:addr:python.org': 0.40; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.72; 'imperative': 0.91
X-CM-Score 0.00
X-CNFS-Analysis v=2.0 cv=Dp/UCRD+ c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=qePWxsfFzlIA:10 a=-CCVtsq90SQA:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=mp_7UQt3dHhn_oTlmiQA:9 a=wPNLvfGTeEIA:10 a=MNNHs_nXZ_Z9_RTA:21 a=w_QUfm7wK0D-BPOA:21 a=0nF1XD0wxitMEM03M9B4ZQ==:117
X-AUTH mrabarnett:2500
Date Sat, 24 Mar 2012 20:24:37 +0000
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: verbs in comments [OT]
References <4f6e2265$0$1382$4fafbaef@reader2.news.tin.it>
In-Reply-To <4f6e2265$0$1382$4fafbaef@reader2.news.tin.it>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.956.1332620684.3037.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1332620684 news.xs4all.nl 6842 [2001:888:2000:d::a6]:60737
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22124

Show key headers only | View raw


On 24/03/2012 19:36, 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?
>
The first is the imperative, the second is what it does (with the
implied "it").

Which form you use depends on what "feels" right.

Probably what I'd do is use the first form where it's called and the
second form where it's defined.

     # Prints the number of words.
     def print_num_words():
        ...

     # Print the number of words.
     print_num_words()

Although in this example the function is better written with a
docstring, and the comment where the function is called doesn't add
anything useful, so it's probably unnecessary.

Back to comp.lang.python | Previous | NextPrevious in thread | Next 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