Alex Martelli wrote:
> On Mar 7, 2006, at 6:15 AM, Georg Brandl wrote:

>>with expr as f:
>>    do something with f

I expect the "with" example here is a red herring,
not intended to have anything to do with the new
"with" statement that's just been added.

> I think the best use cases for 'assignment inside an if or while'  
> condition, as far as they go, require `capturing' a SUB-expression of  
> the condition, rather than the whole condition.  E.g., in C,
> 
> while ( (x=next_x()) < threshold ) ...

IIUC, that would be

   while (next_x() as x) < threshold:
     ...

i.e. 'x as y' would be an expression.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,          | Carpe post meridiam!                 |
Christchurch, New Zealand          | (I'm not a morning person.)          |
[EMAIL PROTECTED]          +--------------------------------------+
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to