>The interesting question is _why_ strings and tuples (etc) are immutable,
>and I don't have an interesting answer to that. Maybe Guido will shed
>more light on these decisions?
I can give you a simple reason:
If strings were mutable any hashing based on strings would become very
tricky. That's why dictionaries don't support lists as keys (or any
mutable object for that matter).
It's not impossible (see Smalltalk), but that would certainly guarantee
some unexpected behavior somewhere down the line. With the current
approach you keep all behavior predictable without really loosing any
functionality.
-Jaap-
-- Jaap Vermeulen +--------------------------+ | Sequent Computer Systems | Internet : jaap@sequent.com | Beaverton, Oregon | Uucp : ...uunet!sequent!jaap +--------------------------+