Explanation of list reference
Marko Rauhamaa
marko at pacujo.net
Fri Feb 14 22:43:57 CET 2014
Chris Angelico <rosuav at gmail.com>:
> be careful of simplifications that will cause problems down the line.
Sure. Let it be said, though, that sometimes you learn through
inaccuracies, a technique used intentionally by Knuth's TeXBook, for
example. In fact, you get through highschool mathematics successfully
without knowing what numbers and variables actually are.
> Distinguishing "small values" from "big values" leads to the obvious
> question: Which is which? And why doesn't this work?
This is related to the recent id(string) question on this forum.
Unfortunately neither the "everything is a reference" model nor the
"small/big" model help you predict the value of an "is" operator in the
ambiguous cases.
Back to the original question, though. Python, I think, is a great
introductory programming language to a complete newbie. Explaining
Python's memory model at some level is necessary right off the bat.
However, it is far from easy to understand. I'm not sure the small/big
way is the best approach, but it seeks to bridge the gap from the naive
understanding of tutorial day one to the presented question (tutorial
day two).
Marko
More information about the Python-list
mailing list