Python Strings

Mike Fletcher mfletch at tpresence.com
Sun Aug 20 02:29:39 EDT 2000


target = fromstr[:]

Of course, the implementation could, I suppose, some day optimise away that
to become a copy of the pointer instead.  Out of curiosity, why do you want
this?  Unless you're interfacing with C and are using the string as a
buffer, you'll not get much benefit from the copying.  The hash values will
still be equal, and the only way to tell them apart is doing an id( ).

Enjoy yourself,
Mike

-----Original Message-----
From: CHRIS [mailto:unk at unk.ororr]
Sent: Sunday, August 20, 2000 2:06 AM
To: python-list at python.org
Subject: Python Strings


How can you make a character-by-character copy of one string to a target
string, with out using a temporary list type variable? IE (with out
doing somethin like this):
...




More information about the Python-list mailing list