[Python-Dev] RE: Decimal class

Tim Peters tim_one@email.msn.com
Mon, 26 May 2003 13:36:23 -0400


[Kevin Jacobs]
>>> Anyhow, the next big thing I want to do is to make Decimal instances
>>> immutable like other Python numeric types, so they can be used as
>>> hash keys, so common values can be re-used, and some of the code can
>>> be simplified.

[Tim]
>> Offhand I didn't see anything in the code that mutates any inputs,
>> so I expect it's at worst close.  But this kind of discussion should
>> be in public, so others can jump in too (especially Eric!).

[Kevin]
> I agree 100%.  Does anyone else have feelings for or against having
> mutable Decimal instances?  In the mean time, I will prepare a patch
> to do this so we can evaluate the practical effects on the code.

Oh yes, they have to be immutable, meaning that no public API operation
mutates a Decimal in a user-visible way.