Pythonically-expressed nested-loop break?

Oren Tirosh oren-py-l at hishome.net
Tue Jan 15 05:12:42 EST 2002


Now that we have nested scopes there is a simple way to achieve a similar
effect: use nested functions and break out of the internal function with a 
return statement.  

It's not quite as flexible as your proposal because it doesn't allow 
breaking out to an arbirary level from any location in the loop but it's 
quite readable and should probably be enough in practice.

	Oren





More information about the Python-list mailing list