<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Include/compile.h, branch v2.1a2</title>
<subtitle>Python interpreter</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/compile.h?h=v2.1a2</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/compile.h?h=v2.1a2'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-01-25T20:06:59Z</updated>
<entry>
<title>PEP 227 implementation</title>
<updated>2001-01-25T20:06:59Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-01-25T20:06:59Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=64949cb753f206c0ca1d83f55d07afd3c179b81a'/>
<id>urn:sha1:64949cb753f206c0ca1d83f55d07afd3c179b81a</id>
<content type='text'>
The majority of the changes are in the compiler.  The mainloop changes
primarily to implement the new opcodes and to pass a function's
closure to eval_code2().  Frames and functions got new slots to hold
the closure.

Include/compile.h
    Add co_freevars and co_cellvars slots to code objects.
    Update PyCode_New() to take freevars and cellvars as arguments
Include/funcobject.h
    Add func_closure slot to function objects.
    Add GetClosure()/SetClosure() functions (and corresponding
    macros) for getting at the closure.
Include/frameobject.h
    PyFrame_New() now takes a closure.
Include/opcode.h
    Add four new opcodes: MAKE_CLOSURE, LOAD_CLOSURE, LOAD_DEREF,
    STORE_DEREF.
    Remove comment about old requirement for opcodes to fit in 7
    bits.
compile.c
    Implement changes to code objects for co_freevars and co_cellvars.

    Modify symbol table to use st_cur_name (string object for the name
    of the current scope) and st_cur_children (list of nested blocks).
    Also define st_nested, which might more properly be called
    st_cur_nested.  Add several DEF_XXX flags to track def-use
    information for free variables.

    New or modified functions of note:
    com_make_closure(struct compiling *, PyCodeObject *)
        Emit LOAD_CLOSURE opcodes as needed to pass cells for free
        variables into nested scope.
    com_addop_varname(struct compiling *, int, char *)
        Emits opcodes for LOAD_DEREF and STORE_DEREF.
    get_ref_type(struct compiling *, char *name)
        Return NAME_CLOSURE if ref type is FREE or CELL
    symtable_load_symbols(struct compiling *)
        Decides what variables are cell or free based on def-use info.
        Can now raise SyntaxError if nested scopes are mixed with
        exec or from blah import *.
    make_scope_info(PyObject *, PyObject *, int, int)
        Helper functions for symtable scope stack.
    symtable_update_free_vars(struct symtable *)
        After a code block has been analyzed, it must check each of
        its children for free variables that are not defined in the
        block.  If a variable is free in a child and not defined in
        the parent, then it is defined by block the enclosing the
        current one or it is a global.  This does the right logic.
    symtable_add_use() is now a macro for symtable_add_def()
    symtable_assign(struct symtable *, node *)
        Use goto instead of for (;;)

    Fixed bug in symtable where name of keyword argument in function
    call was treated as assignment in the scope of the call site. Ex:
        def f():
            g(a=2) # a was considered a local of f

ceval.c
    eval_code2() now take one more argument, a closure.
    Implement LOAD_CLOSURE, LOAD_DEREF, STORE_DEREF, MAKE_CLOSURE&gt;

    Also: When name error occurs for global variable, report that the
    name was global in the error mesage.

Objects/frameobject.c
    Initialize f_closure to be a tuple containing space for cellvars
    and freevars.  f_closure is NULL if neither are present.
Objects/funcobject.c
    Add support for func_closure.
Python/import.c
    Change the magic number.
Python/marshal.c
    Track changes to code objects.
</content>
</entry>
<entry>
<title>REMOVED all CWI, CNRI and BeOpen copyright markings.</title>
<updated>2000-09-01T23:29:29Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2000-09-01T23:29:29Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=8586991099e4ace18ee94163a96b8ea1bed77ebe'/>
<id>urn:sha1:8586991099e4ace18ee94163a96b8ea1bed77ebe</id>
<content type='text'>
This should match the situation in the 1.6b1 tree.
</content>
</entry>
<entry>
<title>ANSI-fication and Py_PROTO extermination.</title>
<updated>2000-07-09T00:20:36Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2000-07-09T00:20:36Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=ea9cb5aebf38741871ad4f28971dcd23ddd77ad2'/>
<id>urn:sha1:ea9cb5aebf38741871ad4f28971dcd23ddd77ad2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Change copyright notice - 2nd try.</title>
<updated>2000-06-30T23:58:06Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2000-06-30T23:58:06Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=ffcc3813d82e6b96db79f518f4e67b940a13ce64'/>
<id>urn:sha1:ffcc3813d82e6b96db79f518f4e67b940a13ce64</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Change copyright notice.</title>
<updated>2000-06-30T23:50:40Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2000-06-30T23:50:40Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=fd71b9e9d496caa510dec56a9b69966558d6ba5d'/>
<id>urn:sha1:fd71b9e9d496caa510dec56a9b69966558d6ba5d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add DL_IMPORT(returntype) for all officially exported functions.</title>
<updated>1998-12-04T18:48:25Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>1998-12-04T18:48:25Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=43466ec7b07de6bcad016bec60839cd6079c5a9c'/>
<id>urn:sha1:43466ec7b07de6bcad016bec60839cd6079c5a9c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Changes to support other object types besides strings</title>
<updated>1998-10-07T19:42:25Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>1998-10-07T19:42:25Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d076c73cc81a974794c9aa7e812931b74d6e03c2'/>
<id>urn:sha1:d076c73cc81a974794c9aa7e812931b74d6e03c2</id>
<content type='text'>
as the code string of code objects, as long as they support
the (readonly) buffer interface.  By Greg Stein.
</content>
</entry>
<entry>
<title>Add co_firstlineno and co_lnotab, for the line number table generated</title>
<updated>1997-01-24T03:41:09Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>1997-01-24T03:41:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=767579854c5b001a6099e1b11164376f60a8e0cd'/>
<id>urn:sha1:767579854c5b001a6099e1b11164376f60a8e0cd</id>
<content type='text'>
by the compiler (in lieu of SET_LINENO instructions).
</content>
</entry>
<entry>
<title>Add co_stacksize field to codeobject structure, and stacksize argument</title>
<updated>1997-01-17T20:59:26Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>1997-01-17T20:59:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=3f6e408a31208d29cf867bb30496bdb1f863d310'/>
<id>urn:sha1:3f6e408a31208d29cf867bb30496bdb1f863d310</id>
<content type='text'>
to PyCode_New() argument list.  Also add CO_MAXBLOCKS constant
indicating the maximum static nesting supported by the compiler.
</content>
</entry>
<entry>
<title>New permission notice, includes CNRI.</title>
<updated>1996-10-25T14:44:06Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>1996-10-25T14:44:06Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d266eb460e20ded087d01a29da0a230e235afc40'/>
<id>urn:sha1:d266eb460e20ded087d01a29da0a230e235afc40</id>
<content type='text'>
</content>
</entry>
</feed>
