intern'ed strings and deepcopy()

Erik Max Francis max at alcyone.com
Fri Apr 11 20:05:30 EDT 2003


Alexander Schmolck wrote:

> No it isn't. The idea of symbols (viz interned strings) is their
> uniqueness
> (amongst other things, establishing identity is faster then
> establishing
> string equality). So I don't think the OP's question is unreasonable:
> you
> might well want to deepcopy some container that contains symbols (and
> you'd
> like to preserve their identity).

My point was that if you find yourself wanting to make a truly unique
copy of a string (an immutable object), then there is almost certainly
something wrong with your design.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ It is human nature to think wisely and act foolishly.
\__/ Anatole France
    Bosskey.net: Quake III Arena / http://www.bosskey.net/q3a/
 A personal guide to Quake III Arena.




More information about the Python-list mailing list