<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Python/marshal.c, branch 2.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/marshal.c?h=2.1</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Python/marshal.c?h=2.1'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-04-10T05:02:52Z</updated>
<entry>
<title>test_pickle works on sizeof(long)==8 boxes again.</title>
<updated>2001-04-10T05:02:52Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-04-10T05:02:52Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=44714007e888acba27d8527122bf618c28a4120b'/>
<id>urn:sha1:44714007e888acba27d8527122bf618c28a4120b</id>
<content type='text'>
pickle.py
    The code implicitly assumed that all ints fit in 4 bytes, causing all
    sorts of mischief (from nonsense results to corrupted pickles).
    Repaired that.
marshal.c
    The int marshaling code assumed that right shifts of signed longs
    sign-extend.  Repaired that.
</content>
</entry>
<entry>
<title>It's unclear whether PyMarshal_XXX() are part of the public or private API.</title>
<updated>2001-01-28T00:27:39Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-01-28T00:27:39Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d9b9ac855c6bb297e7d5549e0d140ff7f48ebee6'/>
<id>urn:sha1:d9b9ac855c6bb297e7d5549e0d140ff7f48ebee6</id>
<content type='text'>
They're named as if public, so I did a Bad Thing by changing
PyMarshal_ReadObjectFromFile() to suck up the remainder of the file in one
gulp:  anyone who counted on that leaving the file pointer merely at the
end of the next object would be screwed.  So restored
PyMarshal_ReadObjectFromFile() to its earlier state, renamed the new greedy
code to PyMarshal_ReadLastObjectFromFile(), and changed Python internals to
call the latter instead.
</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>
<entry>
<title>Variant of SF patch 103252: Startup optimize: read *.pyc as string, not with getc().</title>
<updated>2001-01-18T04:39:16Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-01-18T04:39:16Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=691e0e95de064f04675018ecbf0b74f709253271'/>
<id>urn:sha1:691e0e95de064f04675018ecbf0b74f709253271</id>
<content type='text'>
</content>
</entry>
<entry>
<title>SF bug 119622:  compile errors due to redundant atof decls.  I don't understand</title>
<updated>2000-11-14T20:44:53Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2000-11-14T20:44:53Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=102e457a01bb10d3724c20464b919704ea30744d'/>
<id>urn:sha1:102e457a01bb10d3724c20464b919704ea30744d</id>
<content type='text'>
the bug report (for details, look at it), but agree there's no need for Python
to declare atof itself:  we #include stdlib.h, and ANSI C sez atof is declared
there already.
</content>
</entry>
<entry>
<title>Obscure marshal fixes:</title>
<updated>2000-09-19T08:54:13Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2000-09-19T08:54:13Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=e84b74039bb28b6ae7e4e9291566ee7f13532f93'/>
<id>urn:sha1:e84b74039bb28b6ae7e4e9291566ee7f13532f93</id>
<content type='text'>
    When reading a short, sign-extend on platforms where shorts are
    bigger than 16 bits.
    When reading a long, repair the unportable sign extension that was
    being done for 64-bit machines (it assumed that signed right shift
    sign-extends).
</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>Included assert.h in Python.h -- it's absurd that this basic tool of</title>
<updated>2000-07-23T19:28:35Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2000-07-23T19:28:35Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=8315ea579046727bb234dc4692ca28c8514eacbe'/>
<id>urn:sha1:8315ea579046727bb234dc4692ca28c8514eacbe</id>
<content type='text'>
good C practice hasn't been available to everything all along.
Added Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) macro to pyport.h; this
just casts VALUE from type WIDE to type NARROW, but assert-fails if
Py_DEBUG is defined and info is lost due to casting.
Replaced a line in Fredrik's fix to marshal.c to use the new macro.
</content>
</entry>
<entry>
<title>-- changed w_more to take an integer instead of a char</title>
<updated>2000-07-23T18:24:06Z</updated>
<author>
<name>Fredrik Lundh</name>
<email>fredrik@pythonware.com</email>
</author>
<published>2000-07-23T18:24:06Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=115343849c69d56cd147b8cdc9fe14e068504c60'/>
<id>urn:sha1:115343849c69d56cd147b8cdc9fe14e068504c60</id>
<content type='text'>
   (this is what the callers expect).
</content>
</entry>
<entry>
<title>Mass ANSIfication of function definitions. Doesn't cover all 'extern'</title>
<updated>2000-07-22T18:47:25Z</updated>
<author>
<name>Thomas Wouters</name>
<email>thomas@python.org</email>
</author>
<published>2000-07-22T18:47:25Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=f70ef4f8606f99744252a804229d53a4d97601c1'/>
<id>urn:sha1:f70ef4f8606f99744252a804229d53a4d97601c1</id>
<content type='text'>
declarations yet, those come later.
</content>
</entry>
</feed>
