Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #38823
| Path | csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'broken': 0.03; 'none,': 0.05; 'preferably': 0.05; 'subject:skip:s 10': 0.05; '"if': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'def': 0.10; 'cases': 0.15; "skip:' 30": 0.15; "'a',": 0.16; 'cryptic': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; "{'a':": 0.16; 'wrote:': 0.17; 'url:edu': 0.18; 'combination': 0.22; 'wednesday,': 0.22; 'example': 0.23; 'header :In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.28; '"in': 0.29; 'it."': 0.29; 'this.': 0.29; 'from:addr:yahoo.co.uk': 0.32; 'johnson': 0.32; "skip:' 20": 0.32; "aren't": 0.33; 'skip:j 20': 0.33; 'problem': 0.33; 'to:addr :python-list': 0.33; 'consistent': 0.35; 'table': 0.35; 'received:org': 0.36; 'really': 0.36; 'skip:{ 10': 0.36; 'should': 0.36; 'enough': 0.36; 'bad': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'easy': 0.60; 'face': 0.61; 'charset:windows-1252': 0.65; 'special': 0.73; "'2',": 0.84; '2013': 0.84; 'rick': 0.91; 'refuse': 0.93; 'url:cc': 0.98 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| To | python-list@python.org |
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
| Subject | Re: string.replace doesn't removes ":" |
| Date | Wed, 13 Feb 2013 16:55:36 +0000 |
| References | <mailman.1536.1360407866.2939.python-list@python.org> <92122dd3-ac2e-4407-87ed-0b250ed9c8b9@googlegroups.com> <mailman.1738.1360733201.2939.python-list@python.org> <25d2297a-6fee-4ef5-bcbd-e26a28cf6ce4@e10g2000vbv.googlegroups.com> <fbca1681-2814-4331-91c1-cce852ce530d@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Gmane-NNTP-Posting-Host | 92.18.40.255 |
| User-Agent | Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 |
| In-Reply-To | <fbca1681-2814-4331-91c1-cce852ce530d@googlegroups.com> |
| X-Antivirus | avast! (VPS 130213-0, 13/02/2013), Outbound message |
| X-Antivirus-Status | Clean |
| 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.1746.1360774412.2939.python-list@python.org> (permalink) |
| Lines | 65 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1360774412 news.xs4all.nl 6916 [2001:888:2000:d::a6]:32924 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:38823 |
Show key headers only | View raw
On 13/02/2013 16:34, Rick Johnson wrote:
> On Wednesday, February 13, 2013 1:10:14 AM UTC-6, jmfauth wrote:
>>
>>>>> d = {ord('a'): 'A', ord('b'): '2', ord('c'): 'C'}
>>>>> 'abcdefgabc'.translate(d)
>> 'A2CdefgA2C'
>>>>>
>>>>>
>>>>> def jmTranslate(s, table):
>> ... table = {ord(k):table[k] for k in table}
>> ... return s.translate(table)
>> ...
>>>>> d = {'a': 'A', 'b': '2', 'c': 'C'}
>>>>> jmTranslate('abcdefgabc', d)
>> 'A2CdefgA2C'
>>>>> d = {'a': None, 'b': None, 'c': None}
>>>>> jmTranslate('abcdefgabc', d)
>> 'defg'
>>>>> d = {'a': '€€€€€', 'b': '€€€€', 'c': '€€€€'}
>>>>> jmTranslate('abcdefgabc', d)
>> '€€€€€€€€€€€€€defg€€€€€€€€€€€€€'
>
> [quip] I just really prefer a cryptic solution to a problem when a simplistic and consistent approach would suffice.[/quip] TO HELL WITH THE ZEN!
>
> "Beautiful is better than ugly."
> BROKEN!
>
> "Explicit is better than implicit."
> BROKEN!
>
> "Simple is better than complex."
> BROKEN!
>
> "Sparse is better than dense."
> BROKEN!
>
> "Readability counts."
> BROKEN BROKEN BROKEN!!!!
>
> "Special cases aren't special enough to break the rules."
> BROKEN!
>
> "In the face of ambiguity, refuse the temptation to guess."
> BROKEN!
>
> "There should be one-- and preferably only one --obvious way to do it."
> BROKEN BROKEN BROKEN!
>
> "If the implementation is hard to explain, it's a bad idea."
> BROKEN!
>
> "If the implementation is easy to explain, it may be a good idea."
> REINFORCED BY BAD EXAMPLE
>
jmf and rr in combination reminded me of this. I hope you all get my
drift :)
http://www.cc.gatech.edu/fac/Spencer.Rugaber/poems/love.txt
--
Cheers.
Mark Lawrence
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
string.replace doesn't removes ":" Joshua Robinson <shooki.robinson@gmail.com> - 2013-02-09 06:04 -0500
Re: string.replace doesn't removes ":" Johannes Bauer <dfnsonfsduifb@gmx.de> - 2013-02-10 11:36 +0100
Re: string.replace doesn't removes ":" vduncan80@gmail.com - 2013-02-12 07:14 -0800
Re: string.replace doesn't removes ":" Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-12 20:44 -0800
Re: string.replace doesn't removes ":" Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-12 21:26 -0800
Re: string.replace doesn't removes ":" Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-12 21:26 -0800
Re: string.replace doesn't removes ":" jmfauth <wxjmfauth@gmail.com> - 2013-02-12 23:10 -0800
Re: string.replace doesn't removes ":" Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-13 08:34 -0800
Re: string.replace doesn't removes ":" Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-02-13 16:55 +0000
Re: string.replace doesn't removes ":" Walter Hurry <walterhurry@lavabit.com> - 2013-02-13 18:16 +0000
Re: string.replace doesn't removes ":" 88888 Dihedral <dihedral88888@googlemail.com> - 2013-02-13 12:24 -0800
Re: string.replace doesn't removes ":" jmfauth <wxjmfauth@gmail.com> - 2013-02-14 00:02 -0800
Re: string.replace doesn't removes ":" Rick Johnson <rantingrickjohnson@gmail.com> - 2013-02-12 20:44 -0800
csiph-web