[Python-Dev] Parrot -- should life imitate satire?

Guido van Rossum guido@zope.com
Wed, 01 Aug 2001 09:25:46 -0400


> The vtable interface, at the moment, covers the 
> operators you'd expect to be able to override--assignment, simple math, 
> most string operations, conversion duties, and suchlike things. So this code:
> 
>     a = b + c
> 
> would call the add vtable method for b, and the assign vtable method for a, 

But in Python, this is not an operation on a at all!  It's an
operation on the namespace containing a, and a cannot override it.
I'm sure your VM design can accommodate this, but it points out the
fundamental difference between the languages in their ideas of what a
"variable" is.  Python has at least two types of namespaces in this
context: some namespaces (like module globals) are dictionaries,
others (like function locals) have mapped the variable names to an
array of object references.

--Guido van Rossum (home page: http://www.python.org/~guido/)