A question on modification of a list via a function invocation

Steve D'Aprano steve+python at pearwood.info
Mon Sep 4 10:30:33 EDT 2017


On Tue, 5 Sep 2017 12:09 am, Antoon Pardon wrote:

> Op 04-09-17 om 15:26 schreef Steve D'Aprano:
>> On Mon, 4 Sep 2017 08:52 pm, Antoon Pardon wrote:
>>
>>> 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.
>> Does that mean that IronPython and Jython aren't implementations of Python?
>> They have no reference counts.
> 
> I am not a lawyer

But you are a Python programmer.

You should be aware that reference counts are a property of the CPython
implementation, not a language feature. Jython and IronPython, at the very
least, are valid, conforming implementations of Python the language which have
no reference counts. Therefore reference counts cannot be central to Python's
semantics, since there are Python interpreters that don't use them.

Analogy: we might say that spark plugs are essential, or central, to cars. But
since there are electric cars without spark plugs (and, in the early years of
automotive technology, steam-powered cars without spark plugs) that would be
wrong.





-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list