What other languages use the same data model as Python?

Benjamin Kaplan benjamin.kaplan at case.edu
Wed May 4 13:15:43 EDT 2011


On Wed, May 4, 2011 at 12:40 PM, sturlamolden <sturla at molden.no> wrote:
>
> On May 4, 5:40 pm, Michael Torrie <torr... at gmail.com> wrote:
>
> > Which is exactly what the code showed.  The first one isn't a mistake.
> > You just read it wrong.
>
> No, I read "call-by-value" but it does not make a copy. Call-by-value
> dictates a deep copy or copy-on-write. Python does neither. Python
> pass a handle to the object, not a handle to a copy of the object. If
> you want to see call-by-value in practice, take a look at MATLAB,
> SciLab or Octave; or consider what C++ copy constructors do in
> function calls with value types.

You missed a word in the sentence.

"If you can see this, you DON'T have call-by-value"



More information about the Python-list mailing list