string copying

Robin Becker robin at jessikat.fsnet.co.uk
Fri Mar 29 16:04:14 EST 2002


Is there some special reason why python inhibits string copying. I
suppose there's some attempt being made to make these constants. To make
differing versions of 'abc' one has to resort to silliness like 'ab'+'c'


PythonWin 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on
win32.Portions Copyright 1994-2001 Mark Hammond
(mhammond at skippinet.com.au) - see 'Help/About PythonWin' for further
copyright information.
>>> s='abc'
>>> import copy
>>> s is copy.copy(s)
1
>>> s is copy.deepcopy(s)
1
>>> s is 'ab'+'c'
0
>>> 
-- 
Robin Becker



More information about the Python-list mailing list