On Wed, 4 May 2011 06:12:14 -0700 (PDT), Devin Jeanpierre <jeanpierr...@gmail.com> wrote: : I don't think of "pass-by-value" involving references as being an : implementation-level thing. It's a way of thinking about Python's : behavior: a model. (...) : It isn't particularly contorted. I learned Python this way and it : makes perfect sense. It's just perhaps one level of abstraction away : from the ideal of what some programmers would think in. Python's "pass- : by-value" conforms exactly to the "pass-by-value" of other languages : such as C.
It is contorted and implementation-level because it is one level below the abstraction assumed by the language. It only works by assuming knowledge of C, which is language which has proved unsuitable for complex and abstract data modelling. Digging down into C should be unnecessary to explain Python. By calling it pass-by-value you introduce a new data type which is unknown to Python, namely the pointer. : The only twist is that you never get to dereference : pointers in Python, but you can in C. Not much of a twist if you ask : me, but then again, I've been thinking in this model for years. Maybe : I'm brainwashed. :) You are. You explain Python in terms of C. That's useful when you talk to other speakers of C. If you want to explain the language to a broader audience, you should use terminology from the language's own level of abstraction. -- :-- Hans Georg -- http://mail.python.org/mailman/listinfo/python-list