The “does Python have variables?” debate
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Thu May 8 12:04:51 EDT 2014
On Fri, 09 May 2014 00:51:01 +1000, Chris Angelico wrote:
>>> which is patently false, as
>>> a number of other languages do the same thing (often calling them
>>> variables). So what does "Python doesn't have variables" mean? Really
>>> it's "Python doesn't have variables like C's or Pascal's".
>>
>> Which is what both Ben and I *explicitly* say, when we use this meme.
>
> You might, but he didn't. Compare what he wrote recently:
[...]
If you want to argue that Ben is factually mistaken about Java and
Javascript, go right ahead. But he earlier wrote:
That's why I always try to say “Python doesn't have variables
the way you might know from many other languages”
and
So Python doesn't have variables in the way programmers coming
from many other languages expect. Instead, it has references
bound to values.
Personally, I think that trying to be general and talk about "many other
languages" is a failing strategy. Better to be concrete: C, Pascal,
Algol, Fortran, VB (I think) are good examples of the "value in a box at
a fixed location" model. Of those, Algol, Pascal and Fortran are either
obsolete or legacy, and C is by far the most well-known by people here.
(For some reason, few people seem to migrate from VB to Python.) Hence,
"C-like".
--
Steven D'Aprano
http://import-that.dreamwidth.org/
More information about the Python-list
mailing list