Finding the instance reference of an object
castironpi at gmail.com
Sat Nov 8 21:44:48 CET 2008
On Nov 8, 1:08 am, Steven D'Aprano <st... at REMOVE-THIS-
> On Sat, 08 Nov 2008 18:31:47 +1300, greg wrote:
<Quote in favor of Steven snip>
<Example in favor of Steven snip>
> There's no "obviously" about it. To anyone who has learned that "call-by-
> value" means that a copy is made, "obviously" it does mean copying the
> value. If you have learned a different meaning, then you will believe
I don't think it's obvious to everyone what a copy constructor is and
when it's called. That's ok, it's something you can learn. I think
Joe's idea is that you can think of every variable in Python as a
pointer, and that clears up some confusions about its variable model.
What happens when a pointer is copied? What is an example of copying
a pointer in spoken language?
>>> a= [ 1, 2, 3 ]
Are the following true?
The value of 'a' is an object.
The value of that object is [ 1, 2, 3 ].
The value of 'a' is [ 1, 2, 3 ].
If so, 'value' is ambiguous and therefore not very useful as a term.
More information about the Python-list