"Maurice LING" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> I am designing a tool, in which there are dynamic types and >> variables with these types. In this respect, it is more like an >> interpreted language design. >> >> I wonder how these issues are implemented in Python are there any >> documents or articles about it, which I can read and get an idea.
There is no single doc other that the source, but lots of bits and pieces scattered thru clp archives. The CPython interpreter, tokenizes, parses, and compiles Python to CPython bytecode. The library manual chapter on the dis module defines the stack-based CPython virtual machine. The bytecode is interpreted in a loop with a giant switch (ceval.c). Python objects have a common header and a type-specific value section. For builtin type objects, the value section is a standard set of slots for functions corresponding to the various operators and builtins. For more, see the source or persistently search Google's archive for the group. Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list