python interpreter

Neal Norwitz nnorwitz at gmail.com
Fri Oct 14 00:53:47 EDT 2005


g.franzkowiak wrote:
> Hi everybody,
>
> my interest is for the internals of the Python interpreter.
>
> I've used up to now FORTH for something and this indirect interpreter is
>  very smart.
> --- ASM ---------------------------------------------------------------
>
> Where can I find informations like this for Python ?

Depends on what you want.  If you want to see the disassembled bytes
similar to what I cut out, see the dis module.  (e.g.,
dis.dis(foo_func))

If you want to know how the byte codes are created, it's mostly in
Python/compile.c.  If you want to know how the byte codes are executed,
it's mostly in Python/ceval.c.

All base Python objects implemented in C are under Objects/.  All
standard modules implemented in C are under Modules/.

Get the source and build it.  It's quite readable.

n




More information about the Python-list mailing list