Nick Coghlan wrote:

> It builds the symbol table before actually trying to compile anything. This 
> is 
> what allows it to figure out which load commands to use for which symbols.

Yes, nowadays I expect it makes two passes over the parse
tree for each function, one to build the symbol table and
one to generate the bytecode.

It used to make a single pass over the parse tree and then
post-process the bytecode once it had figured out which
variables were local -- which I suppose you could call
one-and-a-bit passes. :-)

The distinction between one and two passes isn't so
important in a dynamic language like Python anyway, since
most of the interesting things happen at run time.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | A citizen of NewZealandCorp, a       |
Christchurch, New Zealand          | wholly-owned subsidiary of USA Inc.  |
[EMAIL PROTECTED]          +--------------------------------------+
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to