<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Objects/funcobject.c, branch v2.2a3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Objects/funcobject.c?h=v2.2a3</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Objects/funcobject.c?h=v2.2a3'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-08-29T23:54:21Z</updated>
<entry>
<title>Use new GC API.</title>
<updated>2001-08-29T23:54:21Z</updated>
<author>
<name>Neil Schemenauer</name>
<email>nascheme@enme.ucalgary.ca</email>
</author>
<published>2001-08-29T23:54:21Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e83c00efd06dc8380d481f6c5f92d8c274ce6bd2'/>
<id>urn:sha1:e83c00efd06dc8380d481f6c5f92d8c274ce6bd2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>repr's converted to using PyString_FromFormat() instead of sprintf'ing</title>
<updated>2001-08-24T18:34:26Z</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2001-08-24T18:34:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=7ce3694a527afe425a2b9df65c049b0ef4e75960'/>
<id>urn:sha1:7ce3694a527afe425a2b9df65c049b0ef4e75960</id>
<content type='text'>
into a hardcoded char* buffer.

Closes patch #454743.
</content>
</entry>
<entry>
<title>func_getattro(), func_setattro(): Implement the new semantics for</title>
<updated>2001-08-14T18:23:58Z</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2001-08-14T18:23:58Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=142865cae1d68d1a597624af115abb60bd2bf11c'/>
<id>urn:sha1:142865cae1d68d1a597624af115abb60bd2bf11c</id>
<content type='text'>
    setting and deleting a function's __dict__ attribute.  Deleting
    it, or setting it to a non-dictionary result in a TypeError.  Note
    that getting it the first time magically initializes it to an
    empty dict so that func.__dict__ will always appear to be a
    dictionary (never None).

    Closes SF bug #446645.
</content>
</entry>
<entry>
<title>Merge of descr-branch back into trunk.</title>
<updated>2001-08-02T04:15:00Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-08-02T04:15:00Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=6d6c1a35e08b95a83dbe47dbd9e6474daff00354'/>
<id>urn:sha1:6d6c1a35e08b95a83dbe47dbd9e6474daff00354</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Since Py_TPFLAGS_HAVE_WEAKREFS is set in Py_TPFLAGS_DEFAULT, it does not</title>
<updated>2001-05-03T16:04:13Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2001-05-03T16:04:13Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4dcb85b81756fb4b93c296831646c0d015ad38aa'/>
<id>urn:sha1:4dcb85b81756fb4b93c296831646c0d015ad38aa</id>
<content type='text'>
need to be specified in the type structures independently.  The flag
exists only for binary compatibility.

This is a "source cleanliness" issue and introduces no behavioral changes.
</content>
</entry>
<entry>
<title>Add support for weak references to the function and method types.</title>
<updated>2001-03-23T04:19:27Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2001-03-23T04:19:27Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=db81e8ddf8953359e8c2ed9569dd2e774d78ae95'/>
<id>urn:sha1:db81e8ddf8953359e8c2ed9569dd2e774d78ae95</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Visit the closure during traversal and XDECREF it on during deallocation.</title>
<updated>2001-03-01T06:06:37Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-03-01T06:06:37Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=a52e8fe49a625d13d89967bc17adeb71520bf3d0'/>
<id>urn:sha1:a52e8fe49a625d13d89967bc17adeb71520bf3d0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix SF buf 404774 submitted by Gregory H. Ball</title>
<updated>2001-02-28T02:42:56Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-02-28T02:42:56Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=3f571d6497f33945da5ea7791fc533df1f995387'/>
<id>urn:sha1:3f571d6497f33945da5ea7791fc533df1f995387</id>
<content type='text'>
A user program could delete a function's func_closure, which would
cause it to crash when called.
</content>
</entry>
<entry>
<title>The one thing I love more then writing code is deleting code.</title>
<updated>2001-01-29T06:21:17Z</updated>
<author>
<name>Moshe Zadka</name>
<email>moshez@math.huji.ac.il</email>
</author>
<published>2001-01-29T06:21:17Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=497671e094b7f18221cc1f872bfe68afc57c860b'/>
<id>urn:sha1:497671e094b7f18221cc1f872bfe68afc57c860b</id>
<content type='text'>
* Removed func_hash and func_compare, so they can be treated as immutable
  content-less objects (address hash and comparison)
* Added tests to that affect to test_funcattrs (also testing func_code
  is writable)
* Reverse meaning of tests in test_opcodes which checked identical code
  gets identical functions
</content>
</entry>
<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>
</feed>
