changing value of 'self' when subclassing int
Alex Martelli
aleaxit at yahoo.com
Mon Feb 20 12:34:33 EST 2006
More information about the Python-list mailing list
Mon Feb 20 12:34:33 EST 2006
- Previous message (by thread): changing value of 'self' when subclassing int
- Next message (by thread): changing value of 'self' when subclassing int
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
David Coffin <dcoffin at gmail.com> 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 ...integers are immutable, like all other numbers in Python: there is NO way to "change the value of the integer itself". I originally proposed to have "mutable numbers" (at least optionally) in gmpy, but the reaction was a broadside against the idea, to the point that I never got around to it -- gmpy includes a lot of functionality for bit-level manipulation, but still only with immutable bitlists (mapped into gmpy.mpz instances). Alex
- Previous message (by thread): changing value of 'self' when subclassing int
- Next message (by thread): changing value of 'self' when subclassing int
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list