"Maurice LING" <ma*********@acm.org> wrote in message
news:d4**********@domitilla.aioe.org...
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