Issue with new-style classes and operators
Greg Ewing
see_reply_address at something.invalid
Wed Nov 27 22:41:43 EST 2002
Jan Decaluwe wrote:
> Ok, let me explain better. Suppose - for the sake of the
> argument - that I have a legitimate need for mutable numbers.
>
> The point is then that I want to "inherit" the operators
> from the (mutable) value.
If I understand you correctly, then no, you can't
turn an *existing* piece of immutable state into
mutable state -- the best you can do is add a new
piece of mutable state.
But then you won't be able to re-use the existing
operators simply by inheriting them, because
they'll be looking for the state in the old place.
--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg
More information about the Python-list
mailing list