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 there some way for me to change the value of the BitSequence
> object itself? I've also tried wrapping and delegating using
> __getattr__, but I couldn't figure out how to handle in-place methods.
>

Probably your best bet is to have the assignment done as a method call
which returns the new value.

All the best,

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

> Thanks for your help,
> David Coffin
> 
>

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to