passing by refference

Aahz aahz at pythoncraft.com
Sat May 17 09:27:46 EDT 2003


In article <Y3nxa.188397$K35.4450807 at news2.tin.it>,
Alex Martelli  <aleax at aleax.it> wrote:
>Aahz 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.
>
>C, sure.  But I don't see how a Java programmer could possibly be
>confused by Python's semantics for assignment and argument passing:
>they're exactly parallel to the ones Java uses for all types that
>subclass Object -- Java special-cases a few "lower-level" types such 
>as int, but it's even difficult to show where that makes any
>difference (apart from having to wrap int &c in Java if you want
>to hold them in a Vector, and the like).

Given that I don't know Java, I wasn't sure whether Java borrowed C's
semantics for structs; probably should have worded my response a bit
differently.  Sorry about that.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles:  boring syntax, unsurprising semantics,
few automatic coercions, etc etc.  But that's one of the things I like
about it."  --Tim Peters on Python, 16 Sep 93




More information about the Python-list mailing list