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


Groups > comp.lang.python > #64631

Re: generate De Bruijn sequence memory and string vs lists

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!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.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'static': 0.04; 'intermediate': 0.07; 'string': 0.09; 'bytes,': 0.09; 'deprecated': 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; 'subject:string': 0.09; 'translate': 0.10; 'python': 0.11; 'def': 0.12; 'jan': 0.12; 'translation': 0.12; 'language.': 0.14; '23,': 0.16; 'b):': 0.16; 'bytearray': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'str,': 0.16; 'url:whatsnew': 0.16; 'appropriate': 0.16; 'language': 0.16; 'wrote:': 0.18; 'thu,': 0.19; '>>>': 0.22; 'import': 0.22; 'previously': 0.22; 'header:User-Agent:1': 0.23; 'url:dev': 0.24; 'tables': 0.26; 'supported': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'forgot': 0.30; 'noted': 0.31; 'url:python': 0.33; '"the': 0.34; 'subject:lists': 0.35; 'module.': 0.36; 'url:org': 0.36; 'to:addr :python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'gone': 0.61; 'url:3': 0.61; 'first': 0.61; 'our': 0.64; 'otten': 0.84; 'received:89': 0.85
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: generate De Bruijn sequence memory and string vs lists
Date Thu, 23 Jan 2014 20:36:31 +0000
References <CALyJZZVU+j64Jn7fqqzLmwW+KcM=43UMKjo=HW7umnq8MSP2Uw@mail.gmail.com> <lbrjjq$96p$1@ger.gmane.org> <lbrlel$vpq$1@ger.gmane.org> <CALyJZZUn4XvTHSnsJhQwsM7CyXUJJis_BwwoZ8EYAQ209bvfig@mail.gmail.com> <lbrst6$vel$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-89-240-167-171.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
In-Reply-To <lbrst6$vel$1@ger.gmane.org>
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5907.1390509413.18130.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390509413 news.xs4all.nl 2967 [2001:888:2000:d::a6]:50141
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64631

Show key headers only | View raw


On 23/01/2014 20:10, Peter Otten wrote:
> Vincent Davis wrote:
>
>> On Thu, Jan 23, 2014 at 12:02 PM, Peter Otten <__peter__@web.de> wrote:
>>>
>>> I just noted that the first Python loop can be eliminated:
>
>
> Oops, I forgot to paste
>
> import string
> def chars(a, b):
>      return "".join(map(chr, range(a, b)))
> _mapping = string.maketrans(chars(0, 10), chars(48, 58))
>

FTR string.maketrans is gone from Python 3.2+.  Quoting from 
http://docs.python.org/dev/whatsnew/3.2.html#porting-to-python-3-2 "The 
previously deprecated string.maketrans() function has been removed in 
favor of the static methods bytes.maketrans() and bytearray.maketrans(). 
This change solves the confusion around which types were supported by 
the string module. Now, str, bytes, and bytearray each have their own 
maketrans and translate methods with intermediate translation tables of 
the appropriate type."

-- 
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.

Mark Lawrence

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


Thread

Re: generate De Bruijn sequence memory and string vs lists Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-23 20:36 +0000

csiph-web