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


Groups > comp.lang.python > #31533

Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!feeder3.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.128
X-Spam-Level *
X-Spam-Evidence '*H*': 0.75; '*S*': 0.00; 'caller': 0.07; '"if': 0.09; 'oct': 0.16; 'subject: \n ': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'all,': 0.21; 'header:In-Reply-To:1': 0.25; '(e.g.': 0.27; 'replace': 0.27; 'message-id:@mail.gmail.com': 0.27; 'subject:size': 0.29; 'this.': 0.29; 'error': 0.30; 'could': 0.32; 'true.': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'subject:with': 0.36; 'test': 0.36; 'bad': 0.37; 'why': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'evaluate': 0.62; 'more': 0.63; 'decided': 0.65; 'natural': 0.65; 'subject:NOT': 0.84; 'subject:any': 0.84; 'to:name:python': 0.84; 'prone': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=ydbrDvKkqv7j3GqZCfXSOcST77rNMaPvwzagQyUPIQY=; b=DXJ4Y1Mpf1YZ4QdPDslnaOhknrghxFCCZchSp/ngHwFL5eccc61A9DbJ1QQ1VR3pbA GlDH4iXYKfEqwlOzblMV0/Y0p9QP58YPPX9mF4SCSleB4WjRmZ3UJM+mu+uejmaydEBO /I5zAh22SAcJ6Oixzwjr6iPQxDj3UPRtTZC3OJxmNLL8onDmTKiYQ3Yv9wgCY+22gop4 kEgu0v5PQSLb845Lp42LIxspJ4+Nm4qYrDV5SxiQhTJsNnywE24dUDMqtrwjASy90iZe AytSO3PzxEkj0OY741ZeCwM1RNcbLtitppjKNIgZFIlP2Fqxntof4wy3j1Pxu2BW7Dbz IYyA==
MIME-Version 1.0
In-Reply-To <84d4571f-430a-4fb3-8e54-cf6769a2c76f@googlegroups.com>
References <a7454cb7-e6dc-4167-b72a-56a67a5873a7@googlegroups.com> <mailman.2350.1350486045.27098.python-list@python.org> <748e561a-7e75-4b13-be6b-91831d3b59c4@googlegroups.com> <mailman.2354.1350493663.27098.python-list@python.org> <84d4571f-430a-4fb3-8e54-cf6769a2c76f@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Wed, 17 Oct 2012 12:27:12 -0600
Subject Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks?
To Python <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.15
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.2360.1350498464.27098.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350498464 news.xs4all.nl 6939 [2001:888:2000:d::a6]:43779
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31533

Show key headers only | View raw


On Wed, Oct 17, 2012 at 12:17 PM,  <wxjmfauth@gmail.com> wrote:
> Not at all, I knew this. In this I decided to program like
> this.
>
> Do you get it?  Yes/No  or True/False

It's just bad style, because both 'yes' and 'no' evaluate true.

if HasDiacritics('éléphant'):
    print('Correct!')

if HasDiacritics('elephant'):
    print('Error!')

Prints:

Correct!
Error!

You could replace the test with "if HasDiacritics('elephant') ==
'yes':", but why force the caller to write that out when the former
test is more natural and less prone to error (e.g. typoing 'yes')?

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


Thread

Script for finding words of any size that do NOT contain vowels with acute diacritic marks? nwaits <nowaits@gmail.com> - 2012-10-17 07:31 -0700
  Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Dave Angel <d@davea.name> - 2012-10-17 11:00 -0400
    Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 08:32 -0700
      Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-17 11:07 -0600
        Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:17 -0700
          Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Chris Angelico <rosuav@gmail.com> - 2012-10-18 05:22 +1100
          Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-17 12:27 -0600
            Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:33 -0700
            Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:33 -0700
        Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 11:17 -0700
      Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? David Robinow <drobinow@gmail.com> - 2012-10-17 13:16 -0400
        Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-10-17 23:18 +0000
    Re: Script for finding words of any size that do NOT contain vowels with acute diacritic marks? wxjmfauth@gmail.com - 2012-10-17 08:32 -0700

csiph-web