Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #13075
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.040 |
| X-Spam-Evidence | '*H*': 0.92; '*S*': 0.00; 'function,': 0.07; 'nicely': 0.09; 'def': 0.15; 'complicated,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:209.85.213.174': 0.16; 'received:mail- yx0-f174.google.com': 0.16; 'wrote:': 0.16; 'header:In-Reply- To:1': 0.22; 'sep': 0.23; '\xa0if': 0.23; 'pm,': 0.24; 'sat,': 0.28; 'message-id:@mail.gmail.com': 0.29; 'conditional': 0.30; 'logic': 0.30; 'to:addr:python-list': 0.33; 'named': 0.33; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'manually': 0.39; 'word,': 0.39; 'to:addr:python.org': 0.39; 'sense': 0.39; "i'd": 0.40; 'more': 0.60; 'your': 0.61; '1st': 0.70; '10:24': 0.84; 'ware': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=0yOdDtGwTTSSg9m5OmRIK0FNDX3SoRFCuhudNdpFdxE=; b=ZEnzXNqyDK+0MqlnPEnk58WSjbct3m2VlzfNf1n+Zatk47Qsd5chZUA5UlJrJW/ThC XMnw+5H+L/+jQv1zQosWQoLtSq86UXJBer0CrL9vxSeqAp6DnPw13Ftecee/qP9WUEvT IBSMHGJ8nDA3uyLvDBZSWkRtAUSYD01NBdwto= |
| MIME-Version | 1.0 |
| In-Reply-To | <ZFIaq.3398$GZ.577@newsfe03.ams2> |
| References | <678b89fd-82f4-4080-8b36-e4d0ba30cdbf@o9g2000vbo.googlegroups.com> <ZFIaq.3398$GZ.577@newsfe03.ams2> |
| Date | Sun, 11 Sep 2011 01:56:32 +1000 |
| Subject | Re: Doctest failing |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| 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.940.1315670200.27778.python-list@python.org> (permalink) |
| Lines | 17 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1315670200 news.xs4all.nl 2451 [2001:888:2000:d::a6]:55613 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:13075 |
Show key headers only | View raw
On Sat, Sep 10, 2011 at 10:24 PM, Alister Ware <alister.ware@ntlworld.com> wrote: > Ignoring the docttests my process would be to process each word & then > manually capitalize he 1st word, .I would als0 use a comprehension as > makes for cleaner code:- > > def capitalize(word): > if word in small_words: > return word > else: > return word.title() And I'd do this with a lambda, but that's just me. Of course, if your logic is more complicated, it makes more sense to keep it in a named function, but a single conditional call can fit nicely into a lambda. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-10 04:20 -0700
Re: Doctest failing Mel <mwilson@the-wire.com> - 2011-09-10 07:43 -0400
Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:36 -0700
Re: Doctest failing Peter Otten <__peter__@web.de> - 2011-09-10 13:47 +0200
Re: Doctest failing ting@thsu.org - 2011-09-10 19:12 -0700
Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:42 -0700
Re: Doctest failing Thomas Jollans <t@jollybox.de> - 2011-09-10 13:50 +0200
Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:39 -0700
Re: Doctest failing Alister Ware <alister.ware@ntlworld.com> - 2011-09-10 12:24 +0000
Re: Doctest failing Chris Angelico <rosuav@gmail.com> - 2011-09-11 01:56 +1000
Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:40 -0700
Re: Doctest failing Ethan Furman <ethan@stoneleaf.us> - 2011-09-11 11:43 -0700
Re: Doctest failing Chris Angelico <rosuav@gmail.com> - 2011-09-12 11:03 +1000
Re: Doctest failing Ben Finney <ben+python@benfinney.id.au> - 2011-09-12 11:37 +1000
Re: Doctest failing Chris Angelico <rosuav@gmail.com> - 2011-09-12 13:06 +1000
Re: Doctest failing Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-09-12 14:29 +1000
Re: Doctest failing Terry Reedy <tjreedy@udel.edu> - 2011-09-10 13:59 -0400
Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 04:46 -0700
Re: Doctest failing Terry Reedy <tjreedy@udel.edu> - 2011-09-11 13:03 -0400
Re: Doctest failing Terry Reedy <tjreedy@udel.edu> - 2011-09-10 15:36 -0400
Re: Doctest failing Peter Otten <__peter__@web.de> - 2011-09-10 22:49 +0200
Re: Doctest failing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-09-10 16:25 -0700
Re: Doctest failing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-09-10 23:18 -0700
Re: Doctest failing Tigerstyle <laddosingh@gmail.com> - 2011-09-11 09:43 -0700
Re: Doctest failing Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-09-11 12:37 -0700
csiph-web