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).
Logged In: YES user_id=6656 Update post the checking in of PEP 342 stuff. There were a couple of small conflicts, and I added a lot more tests from the PEP (they used PEP 342 dependent generators).