why are some types immutable?

Peter Maas peter at somewhere.com
Sun Jan 16 15:15:35 EST 2005


Torsten Mohr schrieb:
> reading the documentation (and also from a hint from this NG)
> i know now that there are some types that are not mutable.
> 
> But why is it this way?

Immutable types (e.g. strings, tuples) allow for code optimization
in some situations and can be used as dictionary keys. For the latter
reason see:

http://www.python.org/moin/DictionaryKeys

-- 
-------------------------------------------------------------------
Peter Maas,  M+R Infosysteme,  D-52070 Aachen,  Tel +49-241-93878-0
E-mail 'cGV0ZXIubWFhc0BtcGx1c3IuZGU=\n'.decode('base64')
-------------------------------------------------------------------



More information about the Python-list mailing list