[Python-Dev] RE: Decimal class

Tim Peters tim.one@comcast.net
Mon, 26 May 2003 19:13:17 -0400


[Greg Ewing]
> Having mutable decimal instances would feel *very* strange
> to me, given that all other numeric types in Python are
> immutable.
>
> +1 on making them immutable.

I don't believe there's any argument in favor of making them mutable.  The
question may arise because my old FixedPoint class had mutable instances.
That was a mistake -- I wrote that class in an afternoon, and wasn't
thinking when I added the .set_precision() method.  If they're not
immutable, they can't be used as dict keys, and that's a killer-strong
argument all by itself.