why cannot assign to function call

Aaron Brady castironpi at gmail.com
Sun Jan 11 10:21:49 EST 2009


On Jan 11, 8:32 am, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> Steven D'Aprano <st... at REMOVE-THIS-cybersource.com.au> writes:
> > If it walks like pass-by-reference, and smells like pass-by-reference,
> > and swims like pass-by-reference, is it still your contention that it is
> > pass-by-value?
>
> Of course the C example is pass by value.  It's just that the value
> being passed is an address.

I believe, that in order for the C example to be p-b-r, you would need
the following:

void foo(var int bar[2])
{
  bar = malloc( something );
}

Such that the caller reflects the change.



More information about the Python-list mailing list