Brett Cannon wrote:

 > Someone else wrote:

> > When I was just
> > first learning Python I thought this would work:
> >
> >   for item in select_results:
> >       ...
> >   else:
> >       ... stuff when there are no items ...
> >
> > But it doesn't work like that.

I have to agree that's actually a more intuitive use
of "else" in relation to a for-loop. It's a pity that
some other word wasn't chosen that would have left
"else" free for this purpose.

Could something perhaps be done about this in Py3k?
Blatantly changing the meaning of "else" here might
be going too far, but maybe some other construct could
be found that expresses the same intent.

Greg
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to