Op 2005-01-18, Simon Brunning schreef <[EMAIL PROTECTED]>: > On 18 Jan 2005 07:51:00 GMT, Antoon Pardon <[EMAIL PROTECTED]> 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.
Than in the same vain I can say that mutating a key in a dictionary doesn't always cause problems either. Sure it may probably make a key unaccessible directly, but that might or might not 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 > >>> from decimal import Decimal >>> spam = Decimal('1.2') >>> egg = spam >>> spam._int = (1, 3) >>> spam Decimal("1.3") >>> spam is egg True -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list