Interesting thread on comp.lang.perl.misc
ze5yr at my-deja.com
Fri Aug 13 19:07:04 EDT 1999
In article <Pine.GSO.4.10.9908131047510.3761-100000 at crusoe.crusoe.net>,
japhy at pobox.com wrote:
> I wish I could change a string in-place with a function.*
> * meaning:
> def func(str):
> # something modifying str
> str = "foo"
> print str # prints... "bar", for example
Enclose it in a list, which is mutable:
>>> print l
A little clumsy, but it works!
Cliff Crawford -><-
empty-handed I go,
)O( and behold the spade is in my hands
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
More information about the Python-list