A question on modification of a list via a function invocation

Marko Rauhamaa marko at pacujo.net
Tue Sep 5 18:04:17 EDT 2017


Chris Angelico <rosuav at gmail.com>:

> That shows that the Java '==' operator is like the Python 'is'
> operator, and checks for object identity. You haven't manipulated
> pointers at all. In contrast, here's a C program that actually
> MANIPULATES pointers:
>
> [...]
>
> You can't do this with Python, since pointer arithmetic fundamentally
> doesn't exist. You can in C. Can you in Java?

You can't do it in Pascal, either, but Pascal definitely has pointers.

Pointer arithmetics is not an essential part of C. One could argue that
it was a mistake to include it in the language.


Marko



More information about the Python-list mailing list