passing by refference
Joshua Marshall
joshway_without_spam at myway.com
Fri May 16 14:54:40 EDT 2003
Aahz <aahz at pythoncraft.com> wrote:
> In article <873cjfbrxd.fsf at charter.net>,
> Doug Quale <quale1 at charter.net> wrote:
>>
>>Argument passing in Java and C are no different from Python.
> At the technical level, that's correct, provided you define "argument"
> correctly. But because assignment does different things in Python, too
> many Java/C programmers get confused with Python's semantics.
> In C, you have this:
> myStruct a, b;
> a.x = 1;
> b = a;
> a.x = 2;
> print ("%d\n", b.x);
> There's simply nowhere in Python that assignment performs a value copy
> that way. Using "value" to describe both the references to objects and
> to the objects themselves is too confusing. Therefore "call-by-value"
> is confusing and should be avoided when discussing Python.
I think you're just going to have to accept that there are those who
disagree with you.
More information about the Python-list
mailing list