How to Teach Python "Variables"

Hendrik van Rooyen mail at microcorp.co.za
Thu Nov 29 02:39:14 EST 2007


 "J. Clifford Dyer" <jc...nestar.org> wrote:

> This thread is bleedin' demised.

No, you have stunned it.
Delicate threads stun easily.

To get back to the original question, namely how to teach
the concept of a python variable, I would probably take
a harder look at the "wandering names" analogy.  I think it 
was first mentioned some time ago in a similar context
by Dennis.

Heinz = 42

Heinz = [1,2,3,4]

Where is Heinz now?
He is masquerading as a list, after having been an integer...
But he suffers from amnesia, he can't remember his integer days.

And what about the 42?
It is still lurking in limbo, waiting to be Garbage Collected or 
resurrected by a new assignment.

- Hendrik




More information about the Python-list mailing list