Re: changing value of 'self' when subclassing int

2006-02-21 Thread David Coffin
Thanks for all the help. > On 20 Feb 2006, at 17:34, Alex Martelli wrote: > > ...integers are immutable, like all other numbers in Python: there > is NO > way to "change the value of the integer itself". So, on learning that I could subclass the number types, I didn't even consider the fact t

Re: changing value of 'self' when subclassing int

2006-02-21 Thread Nick Craig-Wood
David Coffin <[EMAIL PROTECTED]> wrote: > I'd like to subclass int to support list access, treating the integer > as if it were a list of bits. > Assigning bits to particular indices involves changing the value of > the integer itself, but changing 'self' obviously just alters the > valu

Re: changing value of 'self' when subclassing int

2006-02-21 Thread Fuzzyman
David Coffin wrote: > I'd like to subclass int to support list access, treating the integer > as if it were a list of bits. > Assigning bits to particular indices involves changing the value of > the integer itself, but changing 'self' obviously just alters the > value of that local variable. > Is

Re: changing value of 'self' when subclassing int

2006-02-20 Thread Alex Martelli
David Coffin <[EMAIL PROTECTED]> wrote: > I'd like to subclass int to support list access, treating the integer > as if it were a list of bits. Fine, but: > Assigning bits to particular indices involves changing the value of > the integer itself, but changing 'self' obviously just alters the