Why are strings immutable?

Peter Hansen peter at engcorp.com
Sat Aug 21 00:00:59 EDT 2004


Brent W. Hughes wrote:

> I kind of hate to have to convert a string into a list, manipulate it, and
> then convert it back into a string.  Why not make strings mutable?

It is unlikely you are doing whatever it is you need to do
in the best way possible if you are converting to a list and
back.  What's the use case here?  Can you describe what you
need to accomplish without reference to how you think it should
be accomplished?  Maybe there's a better way...

-Peter



More information about the Python-list mailing list