Michael Gilbert <michael.s.gilb...@gmail.com> added the comment:

hello, i've recently been working on some code where i am processing a 
list, but excluding certain items.  the solution is to use a list 
comprehension in the for statement, which for example looks like:

  for m in [n for n in range( 0 , 5 ) if n != 2]

determining what's going on here isn't immediately obvious (i.e. what's 
this new variable n doing?).  it would be nice to have a more 
streamlined syntax such as:

  for m in range( 0 , 5 ) with m != 2

which is much cleaner and obvious.  the statements following "with" 
could be any conditional expression.

this is just a wishlist item, and i understand that it wouldn't have 
much priority in the grand scheme of things.  thank you for your 
consideration.

----------
nosy:  -benjamin.peterson

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5823>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to