Python String Immutability Broken!

Ken Seehart ken at seehart.com
Mon Aug 25 06:54:50 EDT 2008


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
> ...
- Ken




More information about the Python-list mailing list