Patches item #1435715, was opened at 2006-02-21 00:05
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1435715&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Parser/Compiler
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: mbland (vuduchyl)
Assigned to: Nobody/Anonymous (nobody)
Summary: PEP 343 with statement

Initial Comment:
With Neal Norwitz's help, I've developed this patch
which implements the with statement from PEP 343.  I
still need to flesh out the documentation, and the
contextmanager.py and nested.py files (copied almost
verbatim from the PEP) are very bare-bones, but the
with syntax itself is accompanied by a rather extensive
test.

Most of the patch reflects changes in automatically
generated files.  The most extensive changes were in
Python/ast.c and Python/compile.c, and the test resides
in Lib/test/with_test.py.

I'm very open to comments and suggestions, particularly
with regards to the contortions in compiler_with() in
Python/compile.c.

Also, a few questions regarding the PEP itself:

- Should the grammar be strict about not allowing
extraneous parentheses around "(NAME)" in the
with_var_name rule (Grammar/Grammar)?

- Should "(NAME ,)" (note the trailing comma) be a
valid VAR list?  Compared with the rule for global, the
current definition seems to suffice, but (according to
Neal) seems inconsistent in the light of typical tuple
syntax.

- Should VAR names that are not instantiated prior to
the with statement exist after exiting the scope of the
with statement?

Thanks,

Mike

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1435715&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches

Reply via email to