On Feb 11, 3:47 pm, Westley Martínez wrote:
> No, too confusing. Then people'll want compound loops e.g.:
>
> for a in b if c while d else return x:
> print('Ha ha I'm so clever!')
On Feb 11, 6:34 pm, Steven D'Aprano wrote:
> There's nothing wrong with writing
>
> for x in iterable:
> if
On Fri, Feb 11, 2011 at 7:34 PM, Steven D'Aprano
wrote:
> On Fri, 11 Feb 2011 16:59:52 -0700, Ian Kelly wrote:
>
>> Why not allow the same thing in for-loop conditions?
>
> Because new syntax and new language features means more work. Somebody
> has to write the code, make sure that it doesn't bre
On 2/11/2011 6:10 PM, Benjamin S Wolf wrote:
It occurred to me as I was writing a for loop that I would like to
write it in generator comprehension syntax, eg.
for a in b if c:
Already proposed and rejected. See archives for python-ideas or the
gmane.comp.python.ideas mirror.
--
Terry Ja
On Fri, 11 Feb 2011 16:59:52 -0700, Ian Kelly wrote:
> Why not allow the same thing in for-loop conditions?
Because new syntax and new language features means more work. Somebody
has to write the code, make sure that it doesn't break existing Python
code, test it for bugs, change the document
On Fri, Feb 11, 2011 at 4:47 PM, Westley Martínez wrote:
> No, too confusing. Then people'll want compound loops e.g.:
>
> for a in b if c while d else return x:
> print('Ha ha I'm so clever!')
I've yet to see anybody arguing for while loops to be nested like
that, but we already allow nested
On Fri, 2011-02-11 at 15:10 -0800, Benjamin S Wolf wrote:
> It occurred to me as I was writing a for loop that I would like to
> write it in generator comprehension syntax, eg.
>
> for a in b if c:
>
> rather than using one of the more verbose but allowable syntaxes:
>
> for a in (x for x in
On Feb 11, 11:10 pm, Benjamin S Wolf wrote:
> It occurred to me as I was writing a for loop that I would like to
> write it in generator comprehension syntax, eg.
>
> for a in b if c:
>
> rather than using one of the more verbose but allowable syntaxes:
>
> for a in (x for x in b if c):
>
>