classification
Title: PEP 343 implementation
Type: Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, mwh, zseil (3)
Priority: normal Keywords patch

Created on 2005-07-11 10:09 by mwh, last changed 2007-03-06 13:36 by georg.brandl.

Files
File name Uploaded Description Edit Remove
pep343-impl-1.diff mwh, 2005-07-11 10:09 mwh's patch #1
pep343-impl-2.diff mwh, 2005-08-02 13:46 mwh's patch #2
Messages (4)
msg48577 - (view) Author: Michael Hudson (mwh) Date: 2005-07-11 10:09
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).
msg48578 - (view) Author: Michael Hudson (mwh) Date: 2005-08-02 13:46
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).
msg48579 - (view) Author: Ziga Seilnacht (zseil) Date: 2007-03-06 13:13
Can this patch be closed? Is there still something missing
in the current implementation of with statement?
msg48580 - (view) Author: Georg Brandl (georg.brandl) Date: 2007-03-06 13:36
I guess it can be closed.
History
Date User Action Args
2005-07-11 10:09:53mwhcreate