Message48577
This large patch (nearly 90 K, affecting 25 files!) implements PEP
343.
Work done:
Changes Grammar/Grammar, Python/compile.c and Python/ceval.c
to support new statement (a new opcode, LOAD_EXIT_ARGS, is
possibly not strictly needed, but the stack yoga to avoid it would be
very tiring).
Implements a new __future__ statement, "with_statement", by
cribbing the '#if 0'ed out code from when generators were optional.
Implements support for the with statement in Lib/compiler (but Lib/
compiler doesn't support future statements at all?).
Updates Lib/opcode.py, Lib/symbol.py.
Updates the parser module and it's tests.
Lib/test/test_with.py contains a couple of doctests, one a
reasonably comprehensive tour of with statement functionality and
the other is intended to contain the examples from the PEP, but
most of these depend on PEP 342, the implementation of which
hasn't been checked in yet.
The code isn't the prettiest in places (esp search for the two XXXs). |
|
Date |
User |
Action |
Args |
2007-08-23 15:43:31 | admin | link | issue1235943 messages |
2007-08-23 15:43:31 | admin | create | |
|