<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Include/opcode.h, branch v2.2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/opcode.h?h=v2.2</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Include/opcode.h?h=v2.2'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2001-08-08T05:00:18Z</updated>
<entry>
<title>Implement PEP 238 in its (almost) full glory.</title>
<updated>2001-08-08T05:00:18Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-08-08T05:00:18Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4668b000a1d9113394941ad39875c827634feb49'/>
<id>urn:sha1:4668b000a1d9113394941ad39875c827634feb49</id>
<content type='text'>
This introduces:

- A new operator // that means floor division (the kind of division
  where 1/2 is 0).

- The "future division" statement ("from __future__ import division)
  which changes the meaning of the / operator to implement "true
  division" (where 1/2 is 0.5).

- New overloadable operators __truediv__ and __floordiv__.

- New slots in the PyNumberMethods struct for true and floor division,
  new abstract APIs for them, new opcodes, and so on.

I emphasize that without the future division statement, the semantics
of / will remain unchanged until Python 3.0.

Not yet implemented are warnings (default off) when / is used with int
or long arguments.

This has been on display since 7/31 as SF patch #443474.

Flames to /dev/null.
</content>
</entry>
<entry>
<title>Merging the gen-branch into the main line, at Guido's direction.  Yay!</title>
<updated>2001-06-18T22:08:13Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-06-18T22:08:13Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=5ca576ed0a0c697c7e7547adfd0b3af010fd2053'/>
<id>urn:sha1:5ca576ed0a0c697c7e7547adfd0b3af010fd2053</id>
<content type='text'>
Bugfix candidate in inspect.py:  it was referencing "self" outside of
a method.
</content>
</entry>
<entry>
<title>Iterators phase 1.  This comprises:</title>
<updated>2001-04-20T19:13:02Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-04-20T19:13:02Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=59d1d2b434e8cf79e8b1321f148254c68f56c1f7'/>
<id>urn:sha1:59d1d2b434e8cf79e8b1321f148254c68f56c1f7</id>
<content type='text'>
new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER
new C API PyObject_GetIter(), calls tp_iter
new builtin iter(), with two forms: iter(obj), and iter(function, sentinel)
new internal object types iterobject and calliterobject
new exception StopIteration
new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py)
new magic number for .pyc files
new special method for instances: __iter__() returns an iterator
iteration over dictionaries: "for x in dict" iterates over the keys
iteration over files: "for x in file" iterates over lines

TODO:

documentation
test suite
decide whether to use a different way to spell iter(function, sentinal)
decide whether "for key in dict" is a good idea
use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?)
speed tuning (make next() a slot tp_next???)
</content>
</entry>
<entry>
<title>Allow 'continue' inside 'try' clause</title>
<updated>2001-02-01T22:48:12Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2001-02-01T22:48:12Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=3faa52ecc4aeb30f8913b4dd105184f6f7bc733d'/>
<id>urn:sha1:3faa52ecc4aeb30f8913b4dd105184f6f7bc733d</id>
<content type='text'>
SF patch 102989 by Thomas Wouters
</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>Rich comparisons: ensure that LT == Py_LT, etc.</title>
<updated>2001-01-17T15:21:09Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-01-17T15:21:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c219d55bd02b6b21de088de357b0761a3d1a7ac2'/>
<id>urn:sha1:c219d55bd02b6b21de088de357b0761a3d1a7ac2</id>
<content type='text'>
</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>The real suport for augmented assignment: new opcodes, new PyNumber and</title>
<updated>2000-08-24T20:09:45Z</updated>
<author>
<name>Thomas Wouters</name>
<email>thomas@python.org</email>
</author>
<published>2000-08-24T20:09:45Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=dd8dbdb7172fbafb5ffab8600e620103fc19879e'/>
<id>urn:sha1:dd8dbdb7172fbafb5ffab8600e620103fc19879e</id>
<content type='text'>
PySequence methods and functions, new tokens.
</content>
</entry>
<entry>
<title>Charles G. Waldman &lt;cgw@fnal.gov&gt;:</title>
<updated>2000-08-24T00:32:09Z</updated>
<author>
<name>Fred Drake</name>
<email>fdrake@acm.org</email>
</author>
<published>2000-08-24T00:32:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d'/>
<id>urn:sha1:ef8ace3a6f6cf8396fa92ae62352e8a29ddfca1d</id>
<content type='text'>
Add the EXTENDED_ARG opcode to the virtual machine, allowing 32-bit
arguments to opcodes instead of being forced to stick to the 16-bit
limit.  This is especially useful for machine-generated code, which
can be too long for the SET_LINENO parameter to fit into 16 bits.

This closes the implementation portion of SourceForge patch #100893.
</content>
</entry>
<entry>
<title>PEP 214, Extended print Statement, has been accepted by the BDFL.</title>
<updated>2000-08-21T15:36:27Z</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2000-08-21T15:36:27Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=35fd665981e1eb5a1ba3c88c17e5538178047532'/>
<id>urn:sha1:35fd665981e1eb5a1ba3c88c17e5538178047532</id>
<content type='text'>
This adds the two new opcodes to support this feature: PRINT_ITEM_TO,
PRINT_NEWLINE_TO.
</content>
</entry>
</feed>
