function that modifies a string
Fredrik Lundh
fredrik at pythonware.com
Mon Jul 10 12:41:15 EDT 2006
tac-tics wrote:
> I didn't say that. I meant that arrays in the C++ sense are dangerous.
so what do you think Python's string type uses on the inside ?
> C++ offers pass by value options. That makes it so you never need to
> worry about messing up data that doesn't belong to you unless you
> explicitly pass by reference. Python doesn't do this for you. Thus, a
> mutable string class in Python requires a great deal more care since
> you need to make copies of every string in every function in order to
> prevent changes in one object's string from affecting another.
and that would be different from any other mutable Python type in
exactly what way ?
</F>
More information about the Python-list
mailing list