intern'ed strings and deepcopy()

Erik Max Francis max at
Sat Apr 12 02:05:30 CEST 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 /
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ It is human nature to think wisely and act foolishly.
\__/ Anatole France Quake III Arena /
 A personal guide to Quake III Arena.

More information about the Python-list mailing list