git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


Op 09-06-16 om 13:46 schreef Julien Salort:
> 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...

Yes, what is your point? I know there is a C pointer analogy with
Python variables. The fact that there is an analogy between C pointers
and Python variables, is not enough to conclude that C variables and
Python variables behave exactly the same.

Normal structs are a kind of variable too in C. If you have to
ignore those in order to show similarities, then the variables
in general don't behave exactly the same.