How can you copy (clone) a string?

Martin von Loewis loewis at informatik.hu-berlin.de
Tue Oct 3 11:59:17 EDT 2000


blablu at gmx.net (Mike 'Cat' Perkonigg) writes:

> There seem to be a good optimization :-)

That's the 'strings of length 1' optimization; Python has an array of
256 string. The empty string is also a singleton.

In addition, you have the interned strings which are created in
certain cases.

Regards,
Martin



More information about the Python-list mailing list