Finding the instance reference of an object

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Wed Oct 29 18:58:14 EDT 2008


On Wed, 29 Oct 2008 08:27:07 -0700, Dale Roberts wrote:

> On Oct 28, 11:59 am, Joe Strout <j... at strout.net> wrote:
>> ...
>>
>> There are only the two cases, which Greg quite succinctly and
>> accurately described above.  One is by value, the other is by
>> reference.  Python quite clearly uses by value.  Parameters are
>> expressions that are evaluated, and the resulting value copied into the
>> formal parameter, pure and simple.  The continued attempts to obfuscate
>> this is pointless and wrong.
>>
>> Best,
>> - Joe
> 
> Joe, you are being too generous and expansive here.
> 
> [Play along with me for a minute here...]
> 
> Don't you know? There is really only *ONE* case, and, you are right, it
> is Pass By Value. There is no such thing as Pass By Reference at the
> physical CPU level at all, right? If there is, show it to me. Pass By
> Reference is just a silly idiom developed by high-minded CS academics to
> confuse the rest of us. It has no practical use and should not be given
> its own name, when we already have a good an proper name for it.
[snip]

But Dale, you're wrong. At the physical CPU level, there's no copying of 
bits at all. If we could copy bits, then we could start with 512MB of RAM 
and say "copy all the bits" and end up with 1GB of RAM. So-called copying 
is actually just bit-flipping.

So anyone who talks about copying parameters is talking nonsense. There 
is no "pass by value". It's all pass by bit-flipping.



-- 
Steven



More information about the Python-list mailing list