Modify a string's value

Ben Finney bignose+hates-spam at
Wed Jul 16 06:55:54 CEST 2008

s0suk3 at writes:

> I just came across this unusual situation where I'd like to modify a
> string passed to a function

Again: Why? The normal way to do this is to create a new string and
return that.

> which seems impossible since Python passes arguments by value.

No, Python passes arguments by reference

 \       “For of those to whom much is given, much is required.” —John |
  `\                                                        F. Kennedy |
_o__)                                                                  |
Ben Finney

More information about the Python-list mailing list