Hacker News new | ask | show | jobs
by yuuuuyu 1173 days ago
In C, a variable has traditionally been a box (memory location) that you put things into. Possibly a box that can only contain pointers to other boxes. That mental model breaks down slightly with references that modern C++ prefers, but still is useful.

In python a variable is just a name. Assigments change what object this name references. But nobody is ever going to change which object this name references, unless you do it yourself. They can mutate the object, but not the name, if that makes sense.