The “does Python have variables?” debate

Ben Finney ben at benfinney.id.au
Thu May 8 02:40:45 EDT 2014


Marko Rauhamaa <marko at pacujo.net> writes:

> What you are describing is that Python has pointer semantics.

That doesn't describe it, no. To my eye, “pointer semantics” entails
that one can directly pass a pointer around as a value (which can't be
done for Python references), and that one can de-reference a pointer to
get the value pointed at (which can't be done for Python references).

> Your example, properly understood and translated, will yield
> Python-esque results in any programming language:
>
>    #!/bin/bash
>    a = /tmp/xyz
>    touch $a

Of course, if you feel free to turn “assignment” into something that
isn't assignment at all, you can get different results. But to do so,
you've had to ignore the language's native assignment operator, which
*doesn't* work that way.

I get the impression you're no longer engaging in this discussion trying
to learn, but rather to score points. I refuse to play.

-- 
 \         “Of all classes the rich are the most noticed and the least |
  `\      studied.” —John Kenneth Galbraith, _The Age of Uncertainty_, |
_o__)                                                             1977 |
Ben Finney




More information about the Python-list mailing list