I'm wrong or Will we fix the ducks limp?
Marko Rauhamaa
marko at pacujo.net
Thu Jun 9 09:13:01 EDT 2016
Antoon Pardon <antoon.pardon at rece.vub.ac.be>:
> Op 09-06-16 om 11:19 schreef Marko Rauhamaa:
>> The difference is not in the variables but in the expressions. In
>> Python,
>>
>> 1
>>
>> evaluates to a pointer; in C, it evaluates to an int. Furthermore, in
>> Python,
>>
>> A
>>
>> evaluates to a pointer; in C, it evaluates to a struct.
>
> If a variable evaluates to something different, in different
> languages, the variable don't do the exact same thing in
> the different languages.
In fact, it turns out that the variables are evaluated identically in
both C and Python. In both cases, a variable evaluates to the value the
variable is holding at the moment.
However, since all Python expressions evaluate into pointers, there's no
way to assign anything but a pointer to a variable. In C, expression
evaluation is much more diverse, as is variable typing.
Since Python variable is always holding a pointer, its straightforward
evaluation results in a pointer, closing the circle.
Marko
More information about the Python-list
mailing list