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


Groups > comp.lang.python > #50955

Re: Share Code Tips

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <devyncjohnson@gmail.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; 'languages.': 0.04; 'one?': 0.05; 'great.': 0.07; 'ascii': 0.09; 'collier': 0.09; 'function,': 0.09; 'mind,': 0.09; "people's": 0.09; 'sure,': 0.09; 'yeah,': 0.09; 'ascii,': 0.16; 'combinations': 0.16; 'letters.': 0.16; 'perfect.': 0.16; 'restricting': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'library': 0.18; 'meant': 0.20; 'not,': 0.20; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'comparing': 0.24; 'instead.': 0.24; 'subject:Code': 0.24; 'earlier': 0.24; 'compare': 0.26; 'certain': 0.27; 'header:In- Reply-To:1': 0.27; 'chris': 0.29; 'words': 0.29; 'code': 0.31; 'received:10.0.0': 0.31; 'are.': 0.31; 'documenting': 0.31; 'there.': 0.32; 'limitation': 0.33; 'done.': 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'limitations': 0.36; 'method': 0.36; 'received:10.0': 0.36; 'should': 0.36; 'received:10': 0.37; 'implement': 0.38; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'quote': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; 'dave': 0.60; 'problems.': 0.60; 'till': 0.61; 'mentioned': 0.61; 'range': 0.61; 'course': 0.61; "you're": 0.61; "you've": 0.63; 'such': 0.63; 'goal': 0.75; 'yourself': 0.78; 'future,': 0.83; 'standards,': 0.84; 'unaware': 0.84; 'angel': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=OrNVee1eqVmu6M5GGfYI08mxsovvyOzrrXRytEOzAag=; b=VasTgFhxJK31llBgd1nXt9IrqZYIRbdVZFOMMeTfwKoC+mWu8VTMmHP6Ywyjvjf1Y2 L2WZHTFkgzpCAF09siDQhjJmuvzZEciDKNZmgyYE+oWgxvW3K2kMT7UE6h3skHMS1cD4 AP9cdcgHAo2NVbXl3gixGgeQN9pRO4/8hFKck6/lajPfZQqKYNhe1XBa/mJ6o8OtRCcJ P6yobGKe1PXsHUYZxkpsun6we8tGzpb0GSM/DajbzJze4rdGstinj8cBVTV8beFmdhR5 h66pUjIPldMvwFMJDqp7Sk2xa1AOJ8NxdWzzp3sQR8xjRJ9kIuzfwl9uYypB0TBicDeK itwg==
X-Received by 10.42.226.3 with SMTP id iu3mr12841908icb.117.1374314769549; Sat, 20 Jul 2013 03:06:09 -0700 (PDT)
Date Sat, 20 Jul 2013 06:06:07 -0400
From Devyn Collier Johnson <devyncjohnson@gmail.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7
MIME-Version 1.0
To Python Mailing List <python-list@python.org>
Subject Re: Share Code Tips
References <mailman.4868.1374241904.3114.python-list@python.org> <51e97e6e$0$29971$c3e8da3$5496439d@news.astraweb.com> <51E9B8EB.5060007@Gmail.com> <kscgv5$gv9$1@ger.gmane.org> <51E9E237.2040903@Gmail.com> <kscqf0$429$1@ger.gmane.org>
In-Reply-To <kscqf0$429$1@ger.gmane.org>
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 8bit
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.4911.1374314778.3114.python-list@python.org> (permalink)
Lines 41
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1374314778 news.xs4all.nl 15969 [2001:888:2000:d::a6]:56213
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:50955

Show key headers only | View raw


On 07/19/2013 09:51 PM, Dave Angel wrote:
> On 07/19/2013 09:04 PM, Devyn Collier Johnson wrote:
>>
>
>      <snip>
>>>
>> Chris Angelico said that casefold is not perfect. In the future, I want
>> to make the perfect international-case-insensitive if-statement. For
>> now, my code only supports a limited range of characters. Even with
>> casefold, I will have some issues as Chris Angelico mentioned. Also, "ß"
>> is not really the same as "ss".
>>
>
> Sure, the casefold() method has its problems.  But you're going to 
> avoid using it till you can do a "perfect" one?
>
> Perfect in what context?  For "case sensitively" comparing people's 
> names in a single language in a single country?  Perhaps that can be 
> made perfect.  For certain combinations of language and country.
>
> But if you want to compare words in an unspecified language with an 
> unspecified country, it cannot be done.
>
> If you've got a particular goal in mind, great.  But as a library 
> function, you're better off using the best standard method available, 
> and document what its limitations are.  One way of documenting such is 
> to quote the appropriate standards, with their caveats.
>
>
> By the way, you mentioned earlier that you're restricting yourself to 
> Latin characters.  The lower() method is inadequate for many of those 
> as well.  Perhaps you meant ASCII instead.
>
Of course not, Dave; I will implement casefold. I just plan to not stop 
there. My program should not come across unspecified languages. Yeah, I 
meant ASCII, but I was unaware that lower() had some limitation on Latin 
letters.

Mahalo,
DCJ

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


Thread

Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-19 09:51 -0400
  Re: Share Code Tips Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-19 17:59 +0000
    Re: Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-19 18:08 -0400
      Re: Share Code Tips Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-20 03:18 +0000
        Re: Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-20 06:07 -0400
    Re: Share Code Tips Chris Angelico <rosuav@gmail.com> - 2013-07-20 09:08 +1000
    Re: Share Code Tips Dave Angel <davea@davea.name> - 2013-07-19 19:09 -0400
    Re: Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-19 21:04 -0400
      Re: Share Code Tips Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-20 03:44 +0000
        Re: Share Code Tips David Hutto <dwightdhutto@gmail.com> - 2013-07-20 00:15 -0400
        Re: Share Code Tips David Hutto <dwightdhutto@gmail.com> - 2013-07-20 00:22 -0400
        Re: Share Code Tips David Hutto <dwightdhutto@gmail.com> - 2013-07-20 00:26 -0400
        Re: Share Code Tips David Hutto <dwightdhutto@gmail.com> - 2013-07-20 00:27 -0400
        Re: Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-20 06:10 -0400
        Re: Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-20 08:36 -0400
    Re: Share Code Tips Chris Angelico <rosuav@gmail.com> - 2013-07-20 11:13 +1000
    Re: Share Code Tips Dave Angel <davea@davea.name> - 2013-07-19 21:51 -0400
    Re: Share Code Tips David Hutto <dwightdhutto@gmail.com> - 2013-07-19 23:42 -0400
    Re: Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-20 06:06 -0400
    Re: Share Code Tips Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-20 08:20 -0400

csiph-web