how does CPython work?

Stefan Seefeld seefeld at sympatico.ca
Thu May 27 09:22:50 EDT 2004


beliavsky at aol.com wrote:
> The book "Learning Python" says that a "Python Virtual Machine"
> interprets "byte code" to run a Python program. Is there a book or
> site that describes in more detail what Python is doing behind the
> scenes? One reason for my question is that I want to better understand
> what kinds of Python programs run relatively fast or slow, rather than
> relying solely on trial and error.

beside what has already been said concerning code execution you
should get familiar with python's object model to understand
what a method call implies, for example. Symbols are looked up
in dictionaries (all method objects are usually accessed through
an instance's '__dict__' dictionary for example), so being careful with
the related issues will help you profile and optimize your code, too.

Regards,
		Stefan




More information about the Python-list mailing list