Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #50938
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.002 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'one?': 0.05; 'great.': 0.07; 'ascii': 0.09; 'collier': 0.09; 'function,': 0.09; 'mind,': 0.09; "people's": 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sure,': 0.09; 'combinations': 0.16; 'perfect.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'restricting': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'library': 0.18; 'meant': 0.20; '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:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'words': 0.29; 'code': 0.31; 'are.': 0.31; 'documenting': 0.31; 'done.': 0.35; 'johnson': 0.35; 'but': 0.35; 'really': 0.36; 'limitations': 0.36; 'method': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'quote': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'problems.': 0.60; 'till': 0.61; 'mentioned': 0.61; 'range': 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 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Dave Angel <davea@davea.name> |
| Subject | Re: Share Code Tips |
| Date | Fri, 19 Jul 2013 21:51:32 -0400 |
| 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> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Gmane-NNTP-Posting-Host | 174.32.174.33 |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 |
| In-Reply-To | <51E9E237.2040903@Gmail.com> |
| 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.4897.1374285114.3114.python-list@python.org> (permalink) |
| Lines | 35 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1374285114 news.xs4all.nl 15865 [2001:888:2000:d::a6]:49551 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:50938 |
Show key headers only | View raw
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.
--
DaveA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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