I'm wrong or Will we fix the ducks limp?

Julien Salort lists at juliensalort.org
Thu Jun 9 07:46:03 EDT 2016


Antoon Pardon <antoon.pardon at rece.vub.ac.be> wrote:

>   A.x = 1;
>   A.y = 2;
> 
>   B = A;
> 
>   B.x = 3;
>   B.y = 4;
> 
> 
> In C the variable A will still be x:1, y:2.
> In Python the variable A will be x:3, y:4. 

But it would, if you had written instead:

A->x = 1;
A->y = 2;

B = A;

B->x = 3;
B->y = 4;

which backs indeed the C pointer analogy...


-- 
Julien Salort
Entia non sunt multiplicanda praeter necessitatem
http://www.juliensalort.org



More information about the Python-list mailing list