A question on modification of a list via a function invocation

Antoon Pardon antoon.pardon at vub.be
Mon Sep 4 07:19:02 EDT 2017


Op 04-09-17 om 13:08 schreef Stefan Ram:
> Antoon Pardon <antoon.pardon at vub.be> writes:
>> Op 04-09-17 om 12:22 schreef Stefan Ram:
>>> Rustom Mody <rustompmody at gmail.com> writes:
>>>>> Stefan Ram wrote:
>>>>>> JavaScript and Python do not have references as values
>>>>> Yes, they do. The difference is that they don't have any
>>>> Its because reference (or pointer or ?) is central to python's semantics
>>> If they are so central, then it should be easy to show
>>> quotes from The Python Language Reference to support that
>>> claim.
>> The section about assignment talks about reference counts.
>   Yes, but this only matters for the garbage-collection
>   semantics, not for the main semantics of the assignment.

Yes it does, because it implies that an assignment works
with references. If the assignment didn't work with references
but would work by copying over the old value with the new
value, you wouldn't have reference counts nor garbage collection.
at this level.

-- 
Antoon Pardon




More information about the Python-list mailing list