Label-Value (was: Re: Inheriting the @ sign from Ruby)

Rainer Deyke root at rainerdeyke.com
Thu Dec 14 14:42:26 EST 2000


"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:91a1vr02b02 at news2.newsguy.com...
> There is no value *IN* x.
>
> A variable *REFERS TO* 'a value' (aka 'an object').

If somebody really wants mutable integer objects, they're not that hard to
create.

class MutableInt(UserInt.UserInt):
  def set(self, value):
    self.data = value

x = MutableInt(2) + MutableInt(2)
print x
x.set(5)
print x


--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list