Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65784
| References | <mailman.6584.1391950328.18130.python-list@python.org> <roy-94D93E.11521509022014@news.panix.com> <52F7C097.7050407@stoneleaf.us> |
|---|---|
| Date | 2014-02-10 09:12 +1100 |
| Subject | Re: imperative mood in docstrings |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.6604.1391983969.18130.python-list@python.org> (permalink) |
On Mon, Feb 10, 2014 at 4:53 AM, Ethan Furman <ethan@stoneleaf.us> wrote: > Shouldn't that be: > > class Pig: > def fly(self): > "Soar gracefully through the air if a hot place is very cold." > if hell is frozen: > self.sprout_wings() > self.altitude += 10 > self.velocity += 25 > else: > self.splat() > > ;) The Python 'is' operator does not do what you think it does. If it did, 'hell is frozen' would mean that one could say 'war is frozen', which makes no sense. No, I think this calls for a LISP-style predicate: if frozenp(hell): ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
imperative mood in docstrings bagrat lazaryan <bagratte@live.com> - 2014-02-09 16:05 +0400
Re: imperative mood in docstrings Roy Smith <roy@panix.com> - 2014-02-09 11:52 -0500
Re: imperative mood in docstrings Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-02-09 18:46 +0100
Re: imperative mood in docstrings Ethan Furman <ethan@stoneleaf.us> - 2014-02-09 09:53 -0800
Re: imperative mood in docstrings Chris Angelico <rosuav@gmail.com> - 2014-02-10 09:12 +1100
Re: imperative mood in docstrings Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-09 23:01 +0000
csiph-web