[Patches] [ python-Patches-1492509 ] Unification of list-comp and for syntax

SourceForge.net noreply at sourceforge.net
Sun May 21 17:06:46 CEST 2006


Patches item #1492509, was opened at 2006-05-21 17:06
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=1492509&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: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Heiko Wundram (hwundram)
Assigned to: Nobody/Anonymous (nobody)
Summary: Unification of list-comp and for syntax

Initial Comment:
The following patch adds the ability for:

for <expr> in <expr> if <expr>:
    <do something>

to the Python core. This unifies the syntax of
list/generator comprehensions and the for statement
somewhat, because both now accept conditions which
produce an immediate continue.

I've posted a PEP to python-dev, which details the
changes this patch makes (which are all
backwards-compatible).

The patch doesn't try to address more than the actual
code required to make this feature work yet (except for
changes to Modules/parsermodule.c and Doc/ref/ref7.tex,
which details the for statement). If there's consensus
on this feature, I'll gladly produce more documentation.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1492509&group_id=5470


More information about the Patches mailing list