Convenient filtering in for cycles

Ian Kelly ian.g.kelly at gmail.com
Wed Oct 5 13:39:57 EDT 2011


On Wed, Oct 5, 2011 at 11:24 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
>> Is there some better and valid construction I missed? If not, is there
>> a reason why (2) is not in the language?
>
> I guess because, as you helpfully enumerated, there are already plenty
> of options for iterating with a condition.  Syntax isn't added without
> a strong reason, and avoiding an extra line or an extra indentation
> level isn't enough.

Also, see these older threads:

http://groups.google.com/group/comp.lang.python/browse_thread/thread/ef807313aa47efc/4f4269a7b566cb87
http://groups.google.com/group/python-ideas/browse_thread/thread/87eee156ac2c3a24/61621e7779b5b255
http://groups.google.com/group/python-ideas/browse_thread/thread/e2d076fe35ece873/862674672b4de683

Cheers,
Ian



More information about the Python-list mailing list