Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'example:': 0.03; 'utf-8': 0.07; 'if,': 0.09; 'logic': 0.09; 'pep': 0.09; '\xe2\x80\x94': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; 'books': 0.15; 'dictionary.': 0.16; 'docstring': 0.16; 'docstrings': 0.16; "function's": 0.16; "method's": 0.16; 'roy': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'command': 0.22; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'quickly': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'documenting': 0.31; 'such.': 0.31; 'class': 0.32; 'sense': 0.34; 'could': 0.34; 'received:google.com': 0.35; 'described': 0.36; 'words,': 0.36; 'should': 0.36; 'behind': 0.37; 'so,': 0.37; 'pm,': 0.38; 'does': 0.39; 'new': 0.61; 'from:charset:utf-8': 0.61; 'act': 0.63; 'skip:\xe2 10': 0.65; 'air': 0.66; 'american': 0.66; 'smith': 0.68; '8bit%:43': 0.74; 'article': 0.77; 'url:search': 0.81; '257': 0.84; 'action.': 0.84; 'air.': 0.84; 'performs.': 0.84; 'hand,': 0.93; 'url:tk': 0.95 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Ezi9Y+s7/jikPHN5C2z1JcMQRrZnstDNkmiJnxeNox4=; b=FgV/K1QNUKEmcOMH40mtn499ytF/nZmBS0MXhcR1d3h9ZOpauHx1QidayRFo7U3xYY nID5Z8Mvmp0ABIzwlaSM3z7vvQ4oZIK0SwMMIG4q8HH6aYPKuSl+9wlAXLCkggK3ppNn AB0SSBk1hCcoYFxDBT1g00J5oYNZ95EBA9HLN5BwSdfGfzDFQhKVD7jCQ4RaXW6FZFAf KyTiLAzZCnlF+QK6UDEgGKYvXFbvupuBGzp0CR8x0GYXwevLsPPkjgv6zRZ9oDXgoIbc iUA+wMkdtdI8VOONy3klK/rfTZZ6kTvSEp6upUZqk1dpBFDNvi4lOaIoxn8iz6ylm1Wi YaiA== MIME-Version: 1.0 X-Received: by 10.220.58.202 with SMTP id i10mr286153vch.23.1391967993523; Sun, 09 Feb 2014 09:46:33 -0800 (PST) In-Reply-To: References: Date: Sun, 9 Feb 2014 18:46:33 +0100 Subject: Re: imperative mood in docstrings From: =?UTF-8?B?Q2hyaXMg4oCcS3dwb2xza2HigJ0gV2Fycmljaw==?= To: Roy Smith Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391968001 news.xs4all.nl 2871 [2001:888:2000:d::a6]:38343 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65775 On Sun, Feb 9, 2014 at 5:52 PM, Roy Smith wrote: > In article , > bagrat lazaryan wrote: > >> pep 257 -- docstring conventions, as well as a myriad of books and other >> resources, recommend documenting a function's or method's effect as a co= mmand >> ("do this", "return that"), not as a description ("does this", "returns >> that"). what's the logic behind this recommendation? >> >> bagratte > > Methods are verbs, and should be described as such. If I had: > > class Sheep: > def fly(self): > "Plummet to the ground." > > I'm defining the action the verb performs. If, on the other hand, I had: > > class Sheep: > def fly(self): > "Plummets to the ground" > > I'm no longer describing the action of flying, I'm describing what the > sheep does when it attempts to perform that action. This can also be seen with a (monolingual) dictionary. For example: https://www.google.com/search?q=3Ddefine+fly (that=E2=80=99s actually from = the New Oxford American Dictionary): fly, verb: 1. move through the air under control. 2. move or be hurled quickly through the air. Those could be valid docstrings (if sheep could fly, of course=E2=80=A6) = =E2=80=94 so, in other words, act as if you were writing a dictionary and not Python code. --=20 Chris =E2=80=9CKwpolska=E2=80=9D Warrick PGP: 5EAAEA16 stop html mail | always bottom-post | only UTF-8 makes sense