What other languages use the same data model as Python?
Mel
mwilson at the-wire.com
Mon May 9 13:38:44 EDT 2011
Steven D'Aprano wrote:
> It's not an awful model for Python: a name binding a = obj is equivalent
> to sticking a reference (a pointer?) in box a that points to obj.
> Certainly there are advantages to it.
>
> But one problem is, the model is ambiguous with b = a. You've drawn
> little boxes a and b both pointing to the big box (which I deleted for
> brevity). But surely, if a = 1234 creates a reference from a to the big
> box 1234, then b = a should create a reference from b to the box a?
:) There's a way around that too. Describe literals as "magic names" or
"Platonic names" that are bound to objects in ideal space. I actually
considered that for a while as a way of explaining to newbs why the
characters in a string literal could be different from the characters in the
string value. This would probably have troubles of its own; I never took it
through the knock-down drag-out disarticulation that would show what the
problems were.
Mel.
More information about the Python-list
mailing list