lambda

Simon Brunning simon.brunning at gmail.com
Tue Jan 18 06:55:01 EST 2005


On 18 Jan 2005 07:51:00 GMT, Antoon Pardon <apardon at forel.vub.ac.be> wrote:
> 3 mutating an item in a sorted list *does* *always* cause problems

No, it doesn't. It might cause the list no longer to be sorted, but
that might or might no be a problem.

> More specific the Decimal class is mutable and usable as dict key.

Decimal objects are immutable, so far as I know.

>>> from decimal import Decimal
>>> spam = Decimal('1.2')
>>> eggs = spam
>>> eggs is spam
True
>>> eggs += 1
>>> eggs is spam
False

-- 
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list