How can you copy (clone) a string?

Aahz Maruch aahz at panix.com
Thu Oct 5 16:55:06 EDT 2000


In article <u4s2rwts1.fsf at cs.uu.nl>,  <piet at cs.uu.nl> wrote:
>
>i = 0
>s = 1000 * 'x'
>mem = None
>while 1:
>    i = i+1
>    mem = (mem, s+`i`)

Blech.  If you're going to do a trick like that, just use a list.
-- 
                      --- Aahz (Copyright 2000 by aahz at pobox.com)

Androgynous poly kinky vanilla queer het    <*>     http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6

There's a difference between a person who gets shit zie doesn't
deserve and a person who gets more shit than zie deserves.  --Aahz



More information about the Python-list mailing list