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


Groups > comp.lang.python > #64631 > unrolled thread

Re: generate De Bruijn sequence memory and string vs lists

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2014-01-23 20:36 +0000
Last post2014-01-23 20:36 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#64631 — Re: generate De Bruijn sequence memory and string vs lists

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-01-23 20:36 +0000
SubjectRe: generate De Bruijn sequence memory and string vs lists
Message-ID<mailman.5907.1390509413.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web