The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

Steven D'Aprano steve at pearwood.info
Mon Mar 14 21:19:15 EDT 2016


On Tue, 15 Mar 2016 06:45 am, alister wrote:

> On Mon, 14 Mar 2016 14:43:22 +0000, BartC wrote:
[...]

> > Perhaps it's time to talk about something which many languages have, but
> > Python hasn't. Not as far as I know anyway.
> > 
>> That's references to names (sometimes called pointers). So if I write:
>> 
>>   a = 100 f(a)
>> 
>> then function f gets passed the value that a refers to, or 100 in this
>> case. But how do you pass 'a' itself?


> Congratulations
> you have just proven that you have faild in your understanimg of python @
> stage 1 becuae you keep tying to us it a C


Bart is specifically giving this as an example of something that *Python
cannot do*. Just like it says, in his first paragraph.

I think that, in a discussion of Python's strengths and weaknesses, it is
reasonable to discuss features of other languages that Python doesn't do.
Don't you?



[...]
> python always passes the object bound to a, not the value of a or a
> pointer to a

You might want to slow down a bit and think about this.

What is "the value of a"? Surely it must be *the object bound to a*. What
else could it be? In Python, all values are objects.




-- 
Steven




More information about the Python-list mailing list