[Python-Dev] Conditional For Statements (original) (raw)
Isaac Morland ijmorlan at cs.uwaterloo.ca
Mon May 19 04:07:15 CEST 2008
- Previous message: [Python-Dev] Conditional For Statements
- Next message: [Python-Dev] Conditional For Statements
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, 18 May 2008, Ryan Hitchman wrote:
I'd like to propose an addition to the for statement's syntax:
for {variable} in {iterable} if {condition}: {block} which is equivalent to for {variable} in {iterable}: if not {condition}: continue {block} and for {variable} in filter(lambda: {condition}, iterable): {block} This would make the syntax closer to that of generators, which have 'for variable in iterable if condition', and would improve code clarity by increased brevity and not negating boolean expressions.
http://mail.python.org/pipermail/python-dev/2006-May/065090.html
This was proposed and rejected before, after which it was again proposed and rejected. I think it was also proposed and rejected sometime in 2007, but I can't seem to find it in the archives so my memory may be faulty.
The idea is apparently not dead yet. Hang around a couple of minutes, though. It won't be long.
Isaac Morland CSCF Web Guru DC 2554C, x36650 WWW Software Specialist
- Previous message: [Python-Dev] Conditional For Statements
- Next message: [Python-Dev] Conditional For Statements
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]