Variables vs. names

Bengt Richter bokr at oz.net
Mon Oct 7 04:36:36 EDT 2002


On Sun, 06 Oct 2002 23:25:34 -0700, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:

>Martin v. Löwis fed this fish to the penguins on Sunday 06 October 2002 
>10:44 pm:
>
>> aahz at pythoncraft.com (Aahz) writes:
>> 
>>> Python names don't have values.  Names are always references to
>>> objects. I don't know Java well enough to have any clue how it
>>> handles references, but I know Java doesn't have pointers.
>> 
>                <snip> 
>
>> I believe newcomers to Java have the same problem that they have in
>> Python: "If parameters are passed by reference, how come I cannot
>> modify a variable in the caller?" is a question that I've heard both
>> for Java and for Python.
>>
>        Sounds like we need to drop the use of "reference"...
>
>        If explained as: 
>
>Python names have associations to values. Passing parameters creates 
>duplicates of the association using the dummy argument names. 
>Assignment to a name changes the association of that name to the new 
>value; it does not change any other associations to the value.
>
>the confusion should be reduced.
>
ISTM a glossary of technical Python terms would be good. A concise document
whose explanatory gems could be polished in the gyrating sand barrel
of newsgroup discussion and contention until ready to be set as crown jewels
in the Python docs.

Can someone point me to the closest current approximation?

Regards,
Bengt Richter



More information about the Python-list mailing list