Python String Immutability Broken!
Terry Reedy
tjreedy at udel.edu
Mon Aug 25 12:36:09 EDT 2008
Ken Seehart wrote:
> Hendrik van Rooyen wrote:
>>
>> ...
>>
>> Actually, I am not complaining - I am asking for advice on the side
>> effects of what I am doing, which is replacing a bunch of bits
>> in what is essentially an output bit field with the corresponding
>> input bits at the same addresses read back from a simulated i/o
>> bus structure. And I would also like to know if there is a better
>> way of doing this.
>>
> Yes, there is a better way. Use a character array instead of a string.
>
> http://python.net/crew/theller/ctypes/tutorial.html#arrays
Which essentially is the bytearray type of 3.0.
More information about the Python-list
mailing list