Is 'everything' a refrence or isn't it?
rabkin at mweb[DOT]co[DOT]za
Wed Jan 18 02:06:18 EST 2006
Terry Hancock wrote:
> On Sat, 07 Jan 2006 01:29:46 -0500
> Mike Meyer <mwm at mired.org> wrote:
>>From what I can tell, Liskov proposed *three* different
>>passing references to objects: call-by-sharing,
>>call-by-object, and call-by-object-reference.
> "Call by object reference" makes the most sense to me. Names
> in Python are object references: they refer to objects. You
> might almost say "call by name" but that sort of implies
> that you are passing the strings around (which is generally
> untrue), and it doesn't convey what happens when the name is
> something complex like "ham['spam'].eggs()" (i.e.
> "name" carries the conotation of being a simple string,
> although you could argue that it doesn't have to mean that).
Except that what is passed is not "ham['spam'].eggs()" -
that's the *name of where one copy of the objects name is*. The
name is ham['spam'].eggs().id() - usually something like
When I fill in a form (say if I applied for a visa) - three
things could happen:
a) Pass by object reference/name: I write "8x0323xxxxxx081" (my
ID number) or "Max Xxxxx Rabkin" (my name) on the form, so they
know who I am.
b) Your method (pass by container reference?): I write
"The youngest male living at:
32 Xyz Road
They know who I am, until I move house or I get a baby brother.
c) Pass by value: I staple myself to the form. Painful, but
it works. Unless I need a vaccination for the visa. Then I have
to make a copy of myself; one copy gets vaccinated while the
other is getting the visa. Unfortunately, I still can't get
into Italy, because the guy with the visa doesn't have a
vaccination and vice versa.
More information about the Python-list